If $\quad p \implies q\quad $ ($p$ implies $q$), then $p$ is a sufficient condition for $q$.
If $\quad \bar p \implies \bar q \quad$ (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?