That's why it is always good to have an emergency fund so you don't get into this hole in the first place.
It will boils down to savings, we should learn how to save for the future as we do not hold the future and we cannot see it, anything can happen even the things that we do not expect, so it's good to be ready all the time and we have to start saving now and instill discipline to succeed.
We really should be prepared for the future, savings is what we really need and it's the only way we can solve our desperate times if we have it. I know that it's not easy for everyone since we do have a lot of wants in this world that we want to buy and we forget about saving our money but it's necessary.
and people tend to forget to manage their money which is necessary for us, we need to separate every expenses such as what we want and what we need so the remaining money will be on our saving. I wonder why the necessary things like are usually not complied for other people although they already that they are often in the situation that they are in desperate need.