I am going to disagree a bit.
The area right next to the Hbf--as in, the side of the station, parking lot, and first 100m, especially toward the ZOB--are definitely a bit grubby and not my top recommendation. But head down Lange Reihe and you have some really great options, and it isn't unsafe.
But if you want my recommendations (keeping in mind that I haven't actually stayed in the hotels themselves as I live in Hamburg) based on location, here are a few in areas that are not on anyone's immediate radar but are great for food.
Near the Michaelisbrücke (S-Bahn Stadthausbrücke and U-Bahn Rödingsmarkt are just a few meters away):
Fraser Suites: https://www.frasershospitality.com/en/germany/hamburg/fraser-suites-hamburg/?utm_source=google_map&utm_medium=organic
Steinberger Hotel: https://hrewards.com/de/steigenberger-hotel-hamburg?wt_mc=seo_listing.shr.yext.hamburg.hotel_link.text_cta
LOTS of business folks stay here during conventions, especially during the G20. A bit undiscovered in some sense.
The nearby Großneumarkt is a great place to eat with a range of options. In the other direction is the Deichstraße, where you can also get a good meal. And you are close to a lot of central sites. It isn't that far to Landungsbrücken or the Portuguese Quarter, the latter of which also has great food. You can walk or take either U or S to Landungsbrücken (two or one stop)
Near U-Bahn Baumwall and the Portuguese Quarter:
Madison Hotel: https://madisonhotel.de/?utm_source=gmb&utm_medium=organic&utm_campaign=knowledgegraph
Another great option:
Hotel Hafen Hamburg: https://www.hotel-hafen-hamburg.de/en/
Technically the closest stop is Landungsbrücken (S and U), but it might even be easier to get to it from U-Bahn St. Pauli because you don't have to go up stairs and it is just a few meters longer of a walk. But you can walk down to the Landungsbrücken and the adjacent Portuguese Quarter, up to the Reeperbahn / St. Pauli, easily get to both S and U Bahn to get anywhere in the city. Also, their Tower Bar has some of the best views in the city if you don't mind an overpriced cocktail.
Hamburg is VERY walkable regardless, and everything is extremely safe. As a woman I have never felt unsafe going out for drinks, then coming home at night alone on the S-Bahn. And you are never more than a few minutes' walk from an U- or S-Bahn, and the stops are very close together in the heavily traveled areas. It's a SUPER easy city to get around.
Incidentally, don't rely solely on sources like Google Maps for Hamburg food. It shows Großneumarkt as rather sparse, yet there is a Bavarian, Italian, Irish Pub, and Burger joint with lovely outdoor seating all in a row, and that discounts the small sushi and other joints there. The amazing food at the Portuguese Quarter also doesn't really show up.
Great food in Sternschanze and in the Karolinenviertel. Both are U-3 (the latter at Feldstraße).
If you want to go a bit fancier, you can try something like the Fairmont Vier Jahreszeiten or the Hotel Atlantic along the Alster (S- and U- Jungfernstieg or Dammtor)
https://www.fairmont.com/vier-jahreszeiten-hamburg/?goto=fiche_hotel&code_hotel=A595&merchantid=seo-maps-DE-A595&sourceid=aw-cen&utm_medium=seo%20maps&utm_source=google%20Maps&utm_campaign=seo%20maps
https://brhhh.com/atlantic-hamburg/
The latter is surprisingly right by the Hbf, but you walk past the "seedy" area and end up at one of the fanciest hotels in the city, which is also home to a German rockstar named Udo Lindenberg. These hotels were used by heads of state during the G20 a few years back (and didn't have rooms left for Trump, who booked too late and had to be helped out by the Hamburg government with a private villa).