Suppose we wish to write A in terms of components that are normal to B,

, and parallel to B,

.
The magnitude of the parallel component will simply be the dot product of the two vectors.
Knowing its magnitude, we can then write it as a vector by multiplying it by a unit vector in the direction of B.
You can then find the normal component by plugging back into the first equation above:
Hopefully you are familiar with the dot product. If not, try googling it; there should be thousands of references out there. If you still need help, just ask.