Modulus operation finding value sattisfying given condition Find the minimum value of $p$ such that
$5^p \equiv 1 \pmod p$.
What is the approach to solve such questions?

Little Fermat asserts that if $p $ is prime number, for any number $a$ not divisible by $p$, we have $\;a^{p-1}\equiv 1\mod p$.
The set of congruence classes of integers not divisible by $p$ form a multiplicative group, which has order $p-1$. By Lagrange's theorem, the order of an element $a$ of this group (i.e. the smallest $r$ such that $a^k\equiv 1\mod p$) is a divisor of $p-1$. Hence to find the order of an element you have to test a finite number of values.
In the present case the order of $5$ is a divisor of $18$, i.e. it can be $1$ (irrelevant for trivial reasons), $3,6,9$ or $18$.
We can calculate the powers of $5$ by the fast exponentiation algorithm (‘square and multiply’, which yields the following values:
\begin{alignat*}{3}
5^2&\equiv 6,\\
&&&5^3\equiv6\cdot5=30\equiv -8&&\mod19,\\
5^4&\equiv6^2\equiv -2,&\qquad&\\
&& &5^6\equiv -2\cdot6\equiv 7&&\mod 19,\\
5^8&\equiv4,\\
&&&5^{\color{red}9}\equiv4\cdot 5\equiv \color{red}1&&\mod 19.
\end{alignat*}
Thus $5$ has order 9 mod. 19.
