Jubarhati, which is about 23 kilometres from the town, is the nearest airport. There are regular flights going from Jubbarhatti to Chandigarh and Delhi. You can easily get a taxi from the airport to get to Shimla or you can ask your hotel to arrange for an airport transfer.
There are several bus services including Himachal Road Transport Corporation buses as well as private operators connecting Shimla to the major cities in North India. Chandigarh is at a distance of 117 kilometres, Manali at 260 kilometres and Delhi at 343 kilometres. If you are going from Delhi, you can take an overnight air conditioned luxury bus from ISBT Kashmiri Gate. Buses go in the morning or later at night - timings can vary from season to season, you can check them online before making a reservation.
The small railway station in Shimla is just 1 kilometre away from the centre of the town and is connected to Kalka by a narrow gauge rail track. The famous toy train of Shimla goes between Kalka and Shimla, covering a distance of 96 kilometres in about 7 hours. Kalka in turn is the nearest rail head, which is connected to Chandigarh and Delhi by regular trains. You can take the Kalka Shatabdi, which goes from New Delhi Railway Station to Kalka Railway Station via Chandigarh.
If you are driving from Delhi, you will have to take the outer Ring Road towards GT Karnal Road, then turn right on NH 1. After you reach Ambala, leave NH 1 and move on to NH 22 towards Kalka. Keep going on same highway towards Solan and then on to Shimla. The journey usually takes about 6-7 hours depending on traffic.
Not sure of best route to Shimla from your city. Search it on routeplanner-