The theory behind a double boiler is tht you will occasionally want to heat something, but very gently. If you're making hollandaise sauce, you want to warm the egg yolks ever so slightly. This improves their ability to form an emulsion.
But if you heat them too much, they'll actually lose their emulsifying properties. And if you really get them too hot, the proteins will curdle and you'll end up making scrambled eggs.
Similarly, when you're melting chocolate, heating it directly can affect its texture, which again has to do with the fact that chocolate is an emulsion of cocoa solids, fat, and sugar. If you've ever tasted chocolate that had a grainy feel in your mouth, this is likely what happened.
The way a double boiler works is simple. Instead of the ingredients going into a pan on the stovetop directly over the heat source, we bring some water to a simmer in the pot, and then fit a glass or metal bowl over the top of the pot. The steam from the simmering water heats the contents of the bowl.
If you're using a bowl, make sure the bottom of the bowl doesn't come into contact with the simmering water. There should be a gap between the water and the bottom of the bowl.
Make sure not to underfill the pot, however, because if all the water boils away, you'll just be heating a dry pan, which could damage it.
In the photo above, I'm whisking egg yolks in a double boiler for making Hollandaise sauce. And in this shot I'm holding up the bowl so you can see how much water is in the pot.
You can purchase a dedicated double boiler insert, which is basically a metal colander without any holes in it. It has a handle, and the bowl is tapered so that it will fit over many different sizes of pans, and it has spouts to make pouring easier.
You can also get a double boiler set, where you get the pot and a flat-bottomed insert that fits into it, along with a lid that fits both the pot and the insert.
Either one of these are fine, but if you already have a pot and a stainless steel or glass bowl, that's really all you need.