The common substance that contracts when heated is rubber. Stretched rubber.
Most things expand when heated for a simple reason: The higher temperature makes the atoms or molecules move faster. They then need more elbow room, spreading farther apart on the average, and that makes the whole substance take up more space.
But rubber can behave differently because of its oddly shaped molecules. They’re like worms in a can, thin, squiggly shaped chains, tangled all together into a disorderly snarl. That is, until you stretch the rubber. When you stretch it, the chains are stretched out straighter, forced to line up along the direction of the stretch.
But that is a very strained, unnatural state for them; you know that because you had to work to stretch them out that way, just as you would to stretch out a spring. As soon as you let go, the rubber molecules return to their compact, crinkled forms, and the rubber as a whole will snap back to its original shape.
What has that got to do with the effects of heat? Well, if you heat the rubber while it is in its stretched-out-molecule form, the heat-induced agitation of the molecules makes them pull in on their ends, which tends to decrease their length. (A wriggling snake is a shorter snake.) The rubber thus tries to revert as much as it can to its more compact form; it contracts.
Cut a wide rubber band, at least a quarter-Inch wide, to make a strip, rather than a loop. Use a tan, rather than a colored, rubber band; the colored ones generally aren’t natural rubber. Tie a weight to one end of the strip and tack the other end to the edge of a shelf, letting the weight hang down freely. The weight should be heavy enough to stretch the rubber moderately. Now heat the rubber band with a hair dryer. Watch carefully and you’ll see the rubber contract, pulling the weight up a bit higher.
Rubber can contract when heated. That’s stretched rubber, remember. Rubber that isn’t stretched will expand when heated, just like anything else.