Let \vec A be the position vector of A and \vec B be the position vector of B. A position vector is a vector that points from the origin to a particular point.
If you plot \vec A, \vec B and \vec {AB}, then you can easily notice that \vec B = \vec A + \vec{AB} using the triangle rule of addition of vectors. (Try it for two-dimensional vectors!)
In this question, \vec A = 4\hat i + 2\hat j - 6 \hat k and \vec B = 9\hat i - \hat j + 3 \hat k. So 9\hat i - \hat j + 3 \hat k = (4 \hat i + 2 \hat j - 6 \hat k )+ \vec {AB}, thus meaning that \vec {AB} = (9 - 4) \hat i + (-1 - 2) \hat j + (3 + 6)\hat k = 5\hat i - 3\hat j + 9 \hat k.