The first suggestion was the best one (there's a procedure to reset the airtag back to factory defaults - think it's removing and putting the battery in 5 times?). Google it if the search here doesn't get it for you.
If you've gotten it wet (really wet!) and/or it's out of warranty and the reset / non-bitterant battery doesn't resolve, then it's toast. Move on.