A common mistake is for people to loosen the headset thinking this will loosen the stem... with quill stems the bolt that tightens the wedge is also what is needed to remove the wedge by the aforementioned method of unscrewing it and tapping it with a hammer and if things are tight and possibly seized in place it needs a firm hand.
The stem itself may be corroded to the inside of the steerer so even after the wedge is loosened it may not budge... this is where penetrating oil and patience are your friend.