Even in the worst situations and most difficult environment, the ability to keep a positive attitude can give you the ability to perform better and speed up the process of rescuing yourself from that situation or otherwise to mitigate the harm you might receive from it.
Positive attitude is not just a state but a habit that you can build over time and you use it when you need it most.