In the following figure, find the direction of friction on the blocks A and B and the ground respectively.
Direction of kinetic friction depends on relative velocity, not on the force.
So, velocity of block A w.r.t block B,
vAB=−3^i−(−6^i)=3^i m/s
For B, A appears to be moving forwards.
Hence, friction will be acting in backward direction on A and in forward direction on B at the interacting surface AB.
Now, velocity of block B w.r.t ground,
vBG=−6^i−0=−6^i
For ground, B appears to move backwards.
Hence, friction will be acting in forward direction on B and in backward direction on the ground.
Now, the FBD can be as shown