As with anywhere, it’s better to travel in a group than alone, and better to avoid walking alone at night. Kathmandu is generally a safe city but beware of pickpockets and nightlife scams, particularly in the Thamel area. Avoid eating street food and drinking tap water. Political tensions are still high in Nepal after a ten-year civil war that ended in 2006, and political demonstrations are common; do not join these.
In terms of transportation, I highly recommend that you avoid overcrowded buses between cities; Nepal is full of high, narrow, curving mountain roads, and it’s better to invest in a (slightly) more expensive ticket for a comfortable, safer ride. In Kathmandu, make sure you look both ways before you cross the street since traffic is chaotic and unpredictable.