Daniel B. answered 06/15/22
A retired computer professional to teach math, physics
In general, there are two tensions -- the tension on the string attached to m1,
and the tension on the string attached to m2.
Their difference is responsible for accelerating the pulley.
In the absence of any information about the pulley, I will assume that its mass is negligible.
In that case the two tensions are the same, and have some common value T.
The block m2 experiences downward force m2g and upward force T.
Their difference, the net force, is responsible for the acceleration a:
m2g - T = m2a
The block m1 experiences downward force m1gsin(θ) parallel to the incline, and
upward force T also parallel to the incline.
Their difference, the net force, is responsible for the common acceleration a:
T - m1gsin(θ) = m1a
That gives us two equations.
If you did not know the acceleration a you could calculate both a and T from those two equations,
and you would get the expression for the acceleration a that you already know.
Then you can substitute a into either of the two equations to calculate T.