When a bank fails there's usually a notice ahead of time which will allow you enough time to remove your money from the bank and transfer it to another bank of your choice.
If you didn't get notice and the bank failed then the FDIC would automatically insure your money up to $250,000.00 and if a bank is not FDIC insured then I would look for a different bank that is FDIC insured as most if not all legit banks are FDIC insured to protect your money in the event of a robbery or bank failure.
When and if you do get notice of a bank failure it's a good idea to move your money out of that bank electronically to another bank that is not failing just to be safe.