The temperature-sensitive nerve endings in your skin detect the difference between your inside body temperature and your outside skin temperature. When your skin cools down, your temperature-sensitive nerves tell you that the object you are touching is cold. An object that feels cold must be colder than your hand, and it must carry your body heat away so that your skin cools down.
Styrofoam (or plastic foam) and metal are two materials that work well for this activity. They both start at room temperature and are both colder than your hand. They do not feel equally cold because they carry heat away from your hand at different rates.
Styrofoam is an insulator—a very poor conductor of heat. When your hand touches the Styrofoam, heat flows from your hand to the Styrofoam and warms the Styrofoam surface. Because this heat is not conducted away quickly, the surface of the Styrofoam soon becomes as warm as your hand, so little or no additional heat leaves your hand. There is no difference in temperature between the inside of your body and the outside of your skin, so the temperature-sensitive nerves detect no difference in temperature. The Styrofoam feels warm.
The metal, in contrast, is a good conductor of heat—it carries heat away quickly. Heat flows from your hand into the metal and then is conducted rapidly away into the bulk of the metal, leaving the metal surface and your skin surface relatively cool. That’s why metal feels cool.