If you have your client configured for IMAP, Thunderbird will synchronise with the new server.
If you did not transfer your emails from your old server to your new server, that means the new state is "empty inbox" and synchronising means "removing everything that's available locally".
To fix this, either do a server-to-server transfer from the old email provider to the new one (there are tools to do that, like imapsync), or try importing emails from a backup into Thunderbird after synchronisation succeeds, so that Thunderbird will upload the messages. It's possible that you will need to use a tool to rewrite the message IDs so that Thunderbird treats the messages as new items.
If you have already cancelled your old server provider (so a server-to-server transfer is not possible), restoring from backups may be your only solution.
If you don't have any backups, your email may not be lost. The first thing you need to do is copy Thunderbird's data folder to a backup location, just in case Thunderbird tries to do maintenance on the file while you're performing recovery. Then, use a tool like Thunderbird Reset Status (I can't quickly find a more up to date tool but they probably exist) to unmark the emails in the Thunderbird mail store as deleted. Then set up backups for your new mail server.
If you use the trick above and Thunderbird starts deleting emails again, repeat the trick but break the email account settings first. Then, set up a second connection to your email account, drag over all the undeleted emails so they get uploaded to the new server.