I have 2 propositions and I don't understand the solution.
$\vdash (p \Rightarrow q) \lor (q \Rightarrow r) $
(LTE = LEM)
I don't understand lines 9 and 10. What is that supposed to mean? If I assume $\lnot q$ then $(q \Rightarrow r)$ is always true, making the proposition true? I don't understand what that symbol on line 9 is supposed to do (I know it means the formula is a contradiction but I don't understand how it's being used here).
$\lnot (\lnot p \lor q) \vdash p$
The Law of the excluded middle is not required for this one.
Same as above. Does it mean that if I assume $\lnot p = 1$ then that makes $(\lnot p \lor q)$ true which makes the left hand side a contradiction? If yes how does that help me?
I have one last question: if I am not told to use the LEM, how do I know when to use it?


For your first question, I think they are using the Principle of Explosion, which says that from a contradiction, anything is provable. An argument for this might go as follows: assume that $p\wedge \neg p$ holds for some proposition $p$ and take any proposition $q$. Then, $p\rightarrow q$ is a true statement because $\neg p$ is true (by assumption). Then, since $p$ is also true, Modus Ponens implies that $q$ holds as well.
For the second question, it seems like $\bot$ is being used to end a proof by contradiction. Namely, if we want to prove that $\neg q$ is true by contradiction, we assume that $q$ is true and deduce $\bot$. This allows us to conclude $\neg q$ by "introducing $\neg$". In the situation you provided, since we want to prove $\neg\neg p$, we assume $\neg p$ and deduce $\bot$. Then we use that $\neg\neg p\rightarrow p$ to conclude that $p$ holds.
There isn't a good rule that necessarily implies that you will be using the Law of Excluded Middle. However, one reason I might think about using it in the first case but not the second is that, in your first example, we have to prove something without using any additional assumptions. In circumstances like this, using LEM would allow us to do a proof by cases where we are allowed to assume something that might help us. In your second example, though, you're proving an implication $A\rightarrow B$ and so in the first line of our proof we get to assume that $A$ is true.