In the process of flying, there are different steps. The first is the booking, but there are others, mostly checking in and boarding.
If you want to fly with your friend, when booking a flight, you should make sure you book the same flight (i.e. same day, same time, and usually same flight number). At least you will go to the airport at the same time and will fly on the same plane.
For most airlines (all the flights I ever flew), the choice of seats is relatively independent from the booking. There are multiple times it can be possible to pick a seat (at booking actually, between booking and check-in, and at boarding), but the most common is at check-in. At that time, a large share of seats are available. So if your only goal is to sit together, be the first to check in. It could be an online check-in, 24 hours in advance or sometimes earlier, or at the airport (if online check-in is not available).
On a close topic, there are now services that offer to friends who want to fly together (but on the same entire itinerary apparently, so this is not for you) to book together but split payment properly. There is a question on that topic.