The physical system consists with a pulley and the block. choosing an inertial frame, let us direct the x-axis as shown in the figure.
Initially the system is in equilibrium position. Now from the condition of translation equilibrium for the block
T0 = mg (1)
Similarly for the rotational equilibrium of the pulley
Now let us disturb the equilibrium of the system no matter in which way to analyse its motion. At an arbitrary position shown in the figure, from Newton's second law of motion for the block
Solving (4) and (7) using the initial condition of the problem
Note: we may solve this problem by using the conservation of mechanical energy also