A free body diagram can be helpful here, to find the direction of all the forces acting on each block.
The acceleration of each block will be equal, since they're connected by the string, so
the 80N force acts to accelerate the total mass (m1+m2). The tension does not effect the acceleration of the total mass, it acts equally at both ends of the rope, so it balances out - it acts to slow the acceleration of
the 22kg block, and causes of the acceleration of the 11kg block (again, easy to see with a free body diagram).
Part (a): To find the acceleration, apply Newton's second law,
F = ma where m is the total mass (m1+m2) and F is the 80N force, as that's the net force acting on the total mass.
Once you find the acceleration, you can use it to find the tension, by T = m2a since the only horizontal force acting on m2 is the tension (if it's not clear, we're still using F = ma, but in this case F = T). We can
also find the tension from m1, but it's easier with m2.
Part (b), we use the same process but have to account for friction, which acts to oppose acceleration. Friction force is given by Fk = μkN = μkmg (μk = 0.1) and acts
on both blocks. The net force is now: F - (μkm1g + μkm2g) = ma, where F = 80N and m is the total mass.
Once you find the acceleration for part (b), we can find the tension as above, but this time we have both tension and friction acting in opposite directions on m2, so
the net force is: T - μkm2g = m2a.