What is the difference between necessary and sufficient conditions? 
*

*If $p\implies q$ ("$p$ implies $q$"), then $p$ is a sufficient condition for $q$.

*If $\lnot p\implies \lnot q$ ("not $p$ implies not $q$"), then $p$ is a necessary condition for $q$.
I don't understand what sufficient and necessary mean in this case. How do you know which one is necessary and which one is sufficient?

Suppose first that $p$ implies $q$. Then knowing that $p$ is true is sufficient (i.e., enough evidence) for you to conclude that $q$ is true. It’s possible that $q$ could be true even if $p$ weren’t, but having $p$ true ensures that $q$ is also true.
Now suppose that $\text{not-}p$ implies $\text{not-}q$. If you know that $p$ is false, i.e., that $\text{not-}p$ is true, then you know that $\text{not-}q$ is true, i.e., that $q$ is false. Thus, in order for $q$ to be true, $p$ must be true: without that, you automatically get that $q$ is false. In other words, in order for $q$ to be true, it’s necessary that $p$ be true; you can’t have $q$ true while $p$ is false.
