After all your final federal returns are filed, mail the IRS a letter with the business's legal name, EIN, address, and the reason you're closing, plus a copy of your EIN letter if you have it.
The IRS won't close the account until every required return is filed and all taxes owed are paid. The EIN itself stays assigned to the business; it isn't given to anyone else. The IRS page has the mailing address.
This answer is general information based on the official agency pages linked above, not tax or legal advice, and your situation may differ. Dulybook is a tracking and guidance tool and doesn't file anything for you. Always confirm on the official agency page. Terms of Service