Assuming that you are talking about not being able to get the stem (the thing that the handlebars attach to) out of the fork (more specifically, the fork steerer tube).
If so: The allen bolt you loosened was the proper first step. At the bottom of that bolt it screws into either a wedge or a tapered plug. When you tighten the bolt, it pulls the wedge up and fixes the stem in the fork steerer tube by pushing the matchine wedge surface on the stem against the tube. If you have a plug-type, then the plug bears on internally tapered surfaces in the stem and push them out, wedging the stem in the tube.
In either case, the most common technique is to slightly loosen the allen bolt, and tap it with a hammer (the purist will say "use a brass punch aka a drift, in between the hammer and the bolt to avoid marring the bolt head). If you do this a couple of times (slightly loosen, then tap) the wedge or plug will disengage and you'll be able to pull the stem out.
If the fork is seized in the frame and you can't turn it, that's another problem. If that's the problem you face, let us know. Good luck.