Answer:
This depends on the state and the type of foreclosure used.
In general, there are two different types of foreclosure.
In judicial foreclosure, banks are required to bring a lawsuit against the homeowners in the local district court. Homeowners are notified of the foreclosure when they are served with the paperwork including the lawsuit complaint the lender has filed. Notification is often done by a sheriff's deputy hand delivering the paperwork or by the bank sending the paperwork via certified mail.
In nonjudicial foreclosure, the bank is able to sell the home at auction without suing the borrowers. Notification is often done by having a sheriff post a Notice of Sale or Notice of Intent to Foreclosure and Sale or similar notice on the property itself. Notices must also be posted in local newspapers, in public gathering places, or at the county courthouse.
The specifics vary by state, but these are the two most common methods of foreclosing on a home and how the debtors are notified of the pending loss of their property.