The Baku airport is located 25 km from the capital and to get to the city center you can use a taxi (there is no bus or train). The public transport in general is crowded and in a bad state. The metro and bus network can be useful, but it is not advised to use it at night because of the strong occurrence of crime. It is preferable to take a taxi from a specialized company. Ask for help in the hotel where you are staying. Trains leaving from Baku are not safe and it is strongly advised not to travel in them.