I don't understand how to use Fermat's little theorem to find remainders e.g if we are asked to find remainder of $50^{50}$ on division by $13$, what is a and what is $p$ in the formula?

Also I wanted to check can we use both congruence classes as well as Fermat's little theorem to find such remainders? How would be write $50^{50}$ on division by $13$ in terms of congruence classes to find the remainder?

I don't exactly understand what a congruence class is, what does it tell us and how is it related to this?