You are probably confused because of two reasons. The first one is the definition of $y_1$, which is not the height, but only the displacement from the equilibrium.

Then by simple trigonometry, $y_1=l-l \cos \alpha$ and $x_1=l \sin \alpha$, which implies $\tan \alpha = \frac {x_1} {l-y_1} $. Or written in cartesian coordinates: $$\vec{x}=l \pmatrix{ \sin \alpha\\1-\cos\alpha}.$$ This implies $$\ddot {\vec x}=l \ddot \alpha \pmatrix{\cos \alpha \\ \sin \alpha}- l \dot \alpha \pmatrix {\sin \alpha \\ \cos \alpha}=l \ddot \alpha~ \vec e_T- l \dot \alpha~ \vec e_l,$$
where $\vec e_T, \vec e_l$ are unit vectors tangential to the circle along which the weight moves resp along $l$.
There are two forces acting on this system: gravity and the centripetal force which keeps the weight on the circular path. Gravity can be split in a linear combination of one part acting along the rope doing no work and one perpendicular to it.
We get:
$$\vec F=\vec F_g + \vec F_z= -m g \sin \alpha ~\vec e_T + m l \dot \alpha ~\vec e_l.$$
Thus by Newtons's law $\vec F= m \ddot {\vec x}$, which simplifies to
$$l \ddot \alpha=-m g \sin \alpha,$$ the equation of motion of the pendulum.
This is a nonlinear differential equation, whose solution is not expressable as a real standard function (see WolframAlpha). However, for most practical purposes it suffices to consider small amplitudes, but then $\sin \alpha \approx \alpha$.
This gives the equation of motion
$$\ddot \alpha =-g \frac m l \alpha$$ and since $x_1=l \sin \alpha \approx l \alpha$, we get $$\ddot x_1=- g \frac m l x.$$
The derivation above is cumbersome, because the coordinates $x_1, y_1$ are not really elegant for describing this system. The "natural" coordinate is $\alpha$. So its preferable to work in Lagrange formalismus, because then we do not need to worry about which forces actually do work on the system.
The kinetic energy T and the potential energy V of the system are:
$$T(\alpha)=\frac 1 2 m v^2(\alpha)= \frac 1 2 m l^2 \dot \alpha^2, \\
V(\alpha)=mg y_2(\alpha)= mgl (1-\cos \alpha),$$
so
$$L=T-V=m l [ \frac 1 2 l \dot \alpha^2 - g (1-\cos \alpha)].$$
This gives the Euler-Lagrange equation
\begin{align}\frac d {dt} \frac {dL}{d\dot \alpha}&=\frac {dL}{d\alpha}, ~~\Rightarrow~~
\frac d {dt} l \dot \alpha =-g \sin \alpha.
\end{align}