Chocolate contains cocoa butter, which is a funky-weird fat. It is very sensitive to heat, and will get clumpy if over-heated.
It is best melted over a double boiler. I have never actually used a double boiler, but make my own by placing a stainless bowl over a simmering pot of water. Be sure there is an inch or so of space between the water and the bottom of the bowl. This space allows the steam to do the heating.
For dark chocolate, place the chocolate in the bowl over simmering water. For milk or white chocolate, get the water simmering, then turn off the heat before putting the chocolate on top. These fattier chocolates must be stirred continuously, or they will easily overheat. Dark chocolate has less cocoa butter, and can be set on top and ignored while it melts.
Don’t get any water, or any liquid, in the melting chocolate. A small amount will cause it to seize, or solidify. It will still taste good, but is useless as melted chocolate.