Android email apps don't have a "clear all" - you have to delete them manually, one at a time.
Go to the website for the email account - it's usually easier to mass-delete from there. (Or install something like Thunderbird on a PC and connect it to that account. Once it syncs [it could take hours with 40,000 emails, so watch TV or something], abut 4 clicks will delete everything in the Trash folder. [click the last one, use the thumb to scroll to the top and shift-click the first one, shift-delete].)