Well .....
Relative velocity of a particle (say B) w.r.t another particla (say A) is nothing but the velocity of B as seen by A .....
Mathematically,
VB/A = VB/ground - VA/ground
The same is for relative acceleration and relative displacement .....
aB/A = aB/ground - aA/ground
SB/A = SB/ground - SA/ground
Just apply these formulae whenever ya require .....
This much is enough to solve any problem regarding relative motion .....
Hope ya find it useful .....