I am guessing this may all depend on the type and size of the foam. I can say that I have heated (with a heat gun) foamies and shaped them quite easily. There was no real technique, just heat it a bit, shape it, heat a bit more, shape a bit more, until I got the shape I wanted.
There are FAR more experienced voices on here than mine however. Give em time and they'll ring in.
for heating foam, use a heat gun on low. hold it about a foot away and move the gun around dont keep it in one spot. as you heat it bend the foam, then heat, then bend and repeat until you get it shaped the way you want. while cooling you may have to keep bending it.
DO NOT keep the heat in one spot. it will warp the foam and make it useless. i learned from experience. there are some youtube vids out there. i had to look for them cause there wasnt much on here when i looked early in the year.
dont know about a hair dryer. i went out to candian tire and bought a jobmate heat gun for $14. i let mine cool on its own. it didnt take long. i would think that forcing it to could may screw with the foam causing it to contort. it didnt take a minute for it to cool and keep shape.
you should practice a bit with scrap. i warpped, blistered and melted my first few pieces. now i got it down to a art.
think of it like blacksmithing with an anvil. you need something infront of you to bend the foam. i mostly used my knee when i made shoulder bell like pieces.