Instead of using the cathesian coordinates (horizontal and vertical axis), you should use the coordinate system "of the rope". The rope fixes the distance of the mass from the center of the rotation. Hence, decompose the focus into a component parallel and orthogonal to the rope. Only the latter contributes to the acceleration.
Which language do you use. Here the matlab code.
%% Solving the exact pendelum ode
clear all force;
g = 9.81; % gravitational constant [in m/s^2]
L = 1; % length of the pendelum [in m]
%% define differential equation as a function handle
dPhidt = @(t,phi) [phi(2); -g/L * sin(phi(1))];
tVec = [0:0.1:20]; % time [in s]
phi0 = [20*pi/180; 0]; % inital conditions
[t,Phi] = ode45(dPhidt, tVec, phi0);
figure(1)
plot(t,Phi(:,1) * 180/pi,'-o',t,Phi(:,2) * 180/pi,'-o')
title('Solution of the exact pendulum equation with ODE45');
xlabel('Time t [in s]');
grid on
legend('\phi [in deg]','\omega [in deg/s]')
%% transform polar coord into carthesian
[x, y] = pol2cart(Phi(:,1)-pi/2, L);
figure(2)
plot(x, y,'-o')
title('Solution of the exact pendulum equation with ODE45');
xlabel('Position A_x [in m]');
ylabel('Position A_y [in m]');
grid on

Note: The pendulum equation $$ \ddot \varphi = -\frac{g}{L} \sin{(\varphi)}$$ which its a second order differential equation, is written in a set of two first order differential equations
$$
\begin{pmatrix}
\dot \varphi \\
\dot \omega
\end{pmatrix}
=
\begin{pmatrix}
\omega \\
- \frac{g}{L} \sin{[\varphi]}
\end{pmatrix}
=
\begin{pmatrix}
phi(2) \\
- \frac{g}{L} \sin{[phi(1)]}
\end{pmatrix}
$$
where the right hand side displays the matlab code.