There are hostels and there are hostels.
Some hostels are very clean, relatively quiet, budget accomodations for people who want decent low cost place to stay. Often they have strict curfew and lights out rules. I am happy to stay at these.
Other hostels are like frat houses. They are party palaces that are loud, often dirty, havens for significant alcohol and drug use. These are prone to petty theft of anything that's not tied down. Although I don't hear many complaints about personal safety, I avoid these.
Many cities have at least one of each kind.
If you look at chat room discussions of different hostels, you will get an idea what type of place it is. If the discussion includes the word dude regularly, it's probably a party hostel. If you see words like clean and quiet regularly, it's probably the budget accomodation the partiers avoid.
You have to decide which one is right for you.