We can solve the problem by using Newton's second law of motion:

(1)
where
the term on the left is the resultant of the forces acting on an object
m is the mass of the object
a is the acceleration of the object
The mass of the ball in this problem is m=1 kg. Two forces are applied, in opposite directions, of 20 N and 12 N, therefore the resultant of the forces is

Therefore, we can rearrange eq.(1) and use these data to find the acceleration of the ball:
