Cleanly extract homemade candle from glass or plastic mold? I have a melted-crayon decorative candle idea, but I can't figure out the last step.

The concept is based on melting crayons using the sun &amp; foil, to create art or new crayons. 

Instead, I want to melt crayons inside a small glass, ceramic or plastic container (preferably glass or even ceramic), such as a shot glass. I will warm up the container with a candle warmer or a beverage warmer plate.

My issue will be removing the formed candle after it's melted as desired. I don't think it'll just pop out once cooled.

Is there a way I can easily remove the wax, keeping the form intact? Or, is there a way to prep the container beforehand?

I should be able to test this on existing small candles or tealights we have that are in glass, but it will be some time before I can test other container materials.

(I don't know if there are different "types" of wax. If there are, please advise what type crayons typically are.)
Wax and Glass have very different rates of thermal expansion. Once the liquid wax has cooled and become solid, and you don't think the glass is at a risk of shattering, I would suggest putting the wax filled mold in the freezer. The wax should just pop loose. If it doesn't a quick rinse of the glass in warm water should release the wax.

This trick also works for wax on tablecloths, napkins, etc.