Step 1 is to install the vanity. This puts the sink tailpiece in its final position.
Then test fit the p-trap to see how far down and over your wall pipe is. If you are lucky, you won't need any extension pieces. Most of the time you will need at most 1 vertical extension piece to get the height correct.
The left-right relationship can be tweaked by rotating the p-trap, if your wall pipe is within about 3" either side of the vertical tailpiece. If it is more than 3", you need to get creative with tinker-toying pipe and fittings together. My recommendation is to use the minimum amount of chrome or plastic. Reason is it is very difficult to get everything tight/leak free if you have alot of slipjoints in the system. Best approach is to use copper sweated pipe and fittings starting from the wall, adding copper until you have a comfortable fit at the p-trap.
Hard to explain to you exactly what to do without seeing your situation. If you can post some pictures it will help. The sink side is easy, the wall side is trial and error.