You can fly direct to Sarajevo with British Airways but as yet there are no low-cost airlines on this route. Go no-frills to Zagreb, Split or Dubrovnik in Croatia and catch a bus over the border.
There are rail services from Zagreb and Ploce (on the Croatian coast) to Mostar and Sarajevo, and overnight trains from Budapest and Belgrade. See the railway map of Bosnia.
Unless you’re coming from the above cities, bus is a good option. There are frequent services running over the border with Montenegro and Croatia. Buses also run between several Croatian cities and Bihac, the adventure capital of Bosnia.
Generally buses are a better bet than trains in Bosnia but the route from Sarajevo and Mostar is the exception. Travel over the Bjelasnica mountains via tunnels and viaducts for proof that the romance of train travel is alive and well.
The bus network covers most places you’ll want to see and is cheap and reliable. The only problem is the lack of straight roads meaning longer journeys can be an issue for those prone to carsickness. You’ll need to pay a small fee to stow your luggage.
With such an efficient bus service, driving is really only necessary if you’re desperate to get off the beaten track. Having said that the roads are quiet and, particularly in the mountains, offer some fantastic views of the countryside.