I am so sorry to hear about your Betta.
There are some heaters which now have automatic fuse if it goes too hot it pops off (need to buy a new one though). Safety switch. Any new ones I get will have that.
Heater horror stories are so scary, because almost every one has one (especially in cooler winter areas or keep house on the cooler side)
Also if it is a Betta, don't forget to leave air space at the top for them to gulp air, just in case any body reading this in the future wants to do this. So cute idea.