Is it safe to walk? if i need to take the metro do you buy tickets at the desk or are there machines?
It's safe to walk but will take you about an hour. Take the ubahn (U1) from the closest stop, which looks like Kaisermühlen VIC, in the direction of Reumannplatz. Get off at Karlsplatz and exit the ubahn station using the exit for the opera.
Buy tickets from the machine before getting on the ubhan. If you buy a single journey ticket or 24/72 hour pass, make sure you get it validated in the blue box when entering the area for the ubhan.
A long walk and not very interesting. If it's a special night out, I would get the hotel to book you a taxi, both ways.
Walking and the U-bahn in Vienna are safe, so KimBux suggestion is also fine.
Your hotel, whilst spectacular, is not in an area with many sights. Because of this you will use the subway and public transport a lot. For that reason I’d buy a pass to cover the full duration of your stay.
It is recommended to check the location of a hotel and the geography of a city, for instance by using Google Maps, in order to get a feeling for areas and distances.
As mentioned above, you cannot walk all the way from this hotel to Karlsplatz, at least it does not make any sense.
Considering that you will have to take public transport each day of your stay, buying a transport pass will definitely pay off.