Generally speaking, hostels are incredibly safe but there are various things you can do to ensure you have a good experience such as drinking responsibly, being respectful of dorm mates, locking your valuables, and packing wisely. Nowadays, there are many boutique hotel-like hostels available.