I am traveling to Vienna soon and my bus for returning home is at 2 a.m.
Is Vienna Erdberg bus station safe during late night?
What can I do or visit while I wait for the bus?
it is not clear as to what you are doing or where you are trying to get to...but if you are waiting for a bus to an unknown destination that departs at 0200, you will just have to sit and wait...with a good book. rest of city will be closed. but i would imagine that it is a safe as any other bus station, with others possibly waiting too.
Vienna's international bus station is an embarrassment, just a parking lot and few containers under an expressway overpass.
Because of that it is not a place to hang out in a comfortable manner, which is why I would go there rather late.
In the past I recommended to kill time at McDonalds at Stephansplatz, which used to be open until 2am, but keep in mind that subways stop running around midnight from Sunday - Thursday, but run throughout the night on Fridays & Saturdays.
I'd find a nice 4 or 5 star hotel and wait there. Grab a drink at the bar or lounge till they close around 11pm, midnight. If you ask nicely the staff will probably let you stay in the lobby area, at a sofa, until 2am.