What helps bacteria survive harsh conditions?

Bacteria can go into a sort of hibernated state to survive in more hostile-to-life environments, such as in places with no food or water. They have a thick cellular wall.