Banks are the ones foreclosing so they can very well prevent foreclosures for the homeowners. However, banks will usually not help homeowners if the homeowners do not help themselves.
If the homeowner knows that he or she cannot pay the bills and will be behind on his or her mortgage payments soon, then it is best to let the bank know early.
You might have to call the bank multiple times over months in order to speak to a supervisor or someone with enough authority to help you with your mortgage situation. If banks think that they might not get any money from you, they often are willing to negotiate and talk more.