What will be the remainder when $2^{31}$ is divided by $5$? The question is given in the title:

Find the remainder when $2^{31}$ is divided by $5$.

My friend explained me this way:

$2^2$ gives $-1$ remainder.
So, any power of $2^2$ will give $-1$ remainder.
So, $2^{30}$ gives $-1$ remainder.
So, $2^{30}\times 2$ or $2^{31}$ gives $3$ remainder.

Now, I cannot understand how he said the last line. So, please explain this line.
Also, how can I do this using modular congruency?

This may be easier: $2^4$ is $16$. Clearly this gives a remainder of $1$. Another way of saying this is that $2^4=5k+1$ for some $k$.
Thus $2^{28}=(2^4)^7=(5k+1)^7$ and if you have ever expand out terms you know that the last constant will still be $1$ and everything else will have a $5k$ in it. Thus the remainder divided by $5$ is still $1$.
Similarly $2^{31}=2^{28}\cdot 2^3$, and since $2^3=8$ has a remainder of $3$, we have two terms who when you multiply you get a reminder of $1\cdot 3$.
