Use of an iron to combat bedbugs and pinworms differs slightly, since pinworms live internally while bedbugs live externally. Specifically, pinworms live in the rectum, then exit the anus at night to lay eggs on the skin around the anus. Therefore, killing the adults and eggs of pinworms is largely a matter of emphasising ironing of underwear, bedding and nightclothes--while bedbugs are more a matter of ironing bedding and the mattress.
Fill the iron with water and set it on the highest temperature steam setting.
Iron the mattress with quick strokes, to prevent bedbugs escaping deep into the mattress. Perform this task once a month as a preventive measure, since bedbugs outside of the mattress can survive up to half a year without a blood meal before coming back for more.
Iron pillows and mattress crevices. Wash pillows monthly, using hot water and/or the hottest dryer setting.
Iron bedding and underwear after each laundering to make sure any eggs are killed. During the daytime, expose the sides of the sheets making contact with the sleeper to daylight, as opposed to making the bed each day. Open up curtains to allow sunlight in to kill any eggs.
Wash sheets and clothes in hot water. Change bedsheets daily until the worms are gone (usually just 2 weeks of medical treatment).
See a physician for medication. The treatment is one or two doses---too simple for there to be an excuse not to pursue it. The medication kills adults but not eggs. Therefore, there are two doses, separated by weeks. This is also why ironing and dryer heat are needed---to kill the eggs that the medication can't affect.
Consider surrounding the bed legs with diatomaceous earth to kill bedbugs. This powdery substance kills them by drying them out.