Many cities around the world have wonderful public transportation systems that you will get to know very well while studying abroad! Riding public transportation is sometimes the best way to experience the local people, language, and overall culture.
Buses and trains will most likely be packed with tourists and locals during the day but will be quite different at night. Most cities will have a significantly less number of riders after 10 pm and will even have different routes that are difficult for tourists to understand if they do not speak the local language.
Just as you would at home, make a plan for the night and think about how you will get home ahead of time. Riding a train, bus, or taxi with friends is always the best option after going out for the night. This is especially important if you have been drinking alcohol. It's always smart to designate a sober monitor to watch over the group and make sure no one tries to go home alone.
Visit this website for more information on safety while traveling abroad.