Both can be perfectly safe; the difference is that hotels give you standardized accountability while Airbnb quality rides almost entirely on how well you screen the listing. Hotels have staff on site, regulated safety standards, and easy recourse at a front desk. Airbnb offers more space and local flavor, but you're trusting an individual host, so your protection comes from reading the signals before booking.
The screening that actually works: book hosts with a long review history and consistently high ratings, and read the recent negative reviews specifically, since patterns of cleanliness, misleading photos, or unresponsive hosts show up there first. Check the listing's exact neighborhood on a map and search how it's regarded at night.
Solo travelers and families often still prefer hotels for the staffed-building factor, which is a fair call.