Food should be cooked or heated in a bain marie when you want to avoid direct contact with the heat source. You can use a bain marie both in the oven and on a stovetop.
In the oven: Add the ingredient or food that you want to cook into a mold or ramekin. Place the molds in a baking dish. Fill the baking dish with hot water until it is no more than ½ the way up the side of the molds. Place the baking dish in an oven preheated to 300°F. Cook for the time indicated in your recipe.
On the stovetop: Chocolate should be melted in a bain marie on the stovetop. Fill a pot of water halfway and place it on the stovetop. Place a bowl or a smaller pot inside. Once the water is not, add the chocolate to the bowl and let melt while stirring from time to time.