I've used hot glue to sort of seal/support electrical stuff, like covering the back of circuit boards as an insulator and wire support. It works, sort of, but doesn't always seal that well (it tends to peel away from metal, in my experience) and as others have said it melts when it gets hot.
I've also used epoxy, but no longer use it. Many years ago I made an electronic ignition for a car, potted it in epoxy and it failed after a few months. Apart from the hassle of picking out the epoxy to try and repair it, I found that the failure had been caused by the epoxy. The stuff is too rigid, so when components heat up and cool down, so expanding and contracting, the epoxy holds them firm, resulting in cracks.
I now usually permanently pot stuff with two pack polyurethane. It remains slightly squidgy, so allows thermal expansion, and it seals things really well. If you use the clear stuff then you can see to pick it out if you need to make a repair, although it is pretty tough. You can get it in easy mix plastic bags here, where you just remove the separator bar and squeeze the two parts together to mix it, inside the sealed bag. You then just cut a corner off and pour.
I've also used silicone rubber, with mixed results. A lot of the silicone caulk in tubes gives off acetic acid as it cures, and this corrodes electrical connections (you can check this by smelling the stuff, if it smells of vinegar then that's acetic acid). It's disastrous when used on copper, as it serious eats the stuff away under the caulk There is a type of silicone caulk that cures by giving off alcohol, usually labelled as sanitary caulk here. This is fine with most electrical stuff, in my experience, and it tends to bond to most things better than the type that gives off acetic acid when curing. Again, if you smell it you can detect the slightly sweet smell of alcohol as it cures. Finally I once tried some two pack silicone intended for mould making for models. This seemed to work well, but is more of a mechanical fix than a waterproofing method, as it doesn't bond well to anything, unless a primer is used first. It is great if you need to repair something though, as it's the easiest stuff I've found to pick out without causing damage to components.