There are many ways to find the equation of the motion of a simple pendulum, but the easiest way seems to be using the conservation of angular momentum.
Let's consider a pendulum made of a mass $M$ and a rope of length $L$, and be $\theta$ the angle between the rope and a vertical line. Then, the only force applied on $M$ whose torque isn't null is the weight of $M$, so we get
$$ ML^2\ddot{\theta} = - Mg \sin(\theta) $$
or $$\ddot{\theta} = -\omega^2 \sin(\theta) $$
where $$\omega = \sqrt{\frac{g}{L}}$$
Now, we have to solve this non-linear differential equation. However, we prefer to deal with linear equation... So we can study a particular case: when $\theta \ll 1 $. Then, we know that $\sin(\theta) \approx \theta$, so the dynamic equation becomes
$$\ddot{\theta} \approx -\omega^2\theta$$
so $$\theta \approx \theta_0 \cos(\omega t + \varphi)$$
We find that, for small angles, the pendulum has an almost harmonic motion.
For bigger angles, the motion can also be found, but this requires harder calculations.
Also, you can try to find the dynamic equation using other methods (energy, Newton's second law, ...), this is a good exercise.