The procedure for obtaining overtime in the US USA It is different depending on whether you entered with a B visa or with the Visa Waiver Program (VWP).
Most European visitors will have used the VWP. In that case, there is a regulatory provision for an extension of up to 30 days called a "satisfactory exit" (8 CFR 217.3 (a)):
§ 217.3 State maintenance.
(a) Satisfactory departure. If an emergency prevents an alien admitted under this part from leaving the United States within his or her authorized period of stay, the district director having jurisdiction over the place of the alien's temporary stay may, at his or her discretion, grant a period of satisfactory departure not to exceed 30 days. If the departure is made during that period, the foreigner will be considered to have successfully completed the visit without exceeding the allotted time.
However, it is not entirely obvious how a successful exit would be requested. There's no info on this on the main USCIS website, and the USCIS dating system website says
If you are within the United States, you can no longer schedule an appointment online using InfoPass for National Offices.
Even if you could manage a 30-day extension with a successful departure, it won't help if you have to stay in the US. USA For more than 30 days after the expiration of your allowed period of stay.
Visitors with B visas can apply to extend their stay. Please note that the relevant date is the I-94 date, not the visa expiration date. The application is somewhat expensive ($ 370 plus $ 85 for biometric services), and cannot be decided before you actually leave, but submitting the application before the expiration of the admission period shown on I-94 will protect you from various negative consequences of staying longer. It also shows good faith.
If you don't know your I-94 expiration date, you can check it at https://i94.cbp.dhs.gov.
Yesterday, I noted in a comment (about an answer that has since been deleted) that it might be easier to get to Canada or another country to avoid staying in the United States. You have now edited the question to note that you intend to do that. In that case, then, it might be helpful to note that it is legally permissible for you to re-enter the US. USA Shortly after his departure, although that is subject to the discretion of the officer at the border and the likelihood of being allowed to do so. It will probably be quite small if you have just been in the US. USA for about 90 days (VWP) or six months (B visa).
Furthermore, there is confusion (even among government officials) about the conditions regarding "short trips" to adjacent countries by VWP visitors, thus returning to the US. USA It may be more difficult for VWP visitors in this position. Such a person could obtain a B visa while in Canada if necessary.