Answer:
See explanation below.
Step-by-step explanation:
Given two blocks of masses M and m, And a force F acting on the block of mass M pulling it outside.
The two masses system can be considered as a whole, With F being the only external force acting on them.
Here the spring force has been ignored as while considering the two system as a whole, it will be accounted as an internal force for the system
Therefore, The acceleration of the system will be:

Now both the masses are moving with this same acceleration towards the direction of force .
Acceleration of mass m = a (as the system is moving as a whole)
Force on the mass m= mass times acceleration.
