The bolt on the stem is probably loose. First, align the handlebars and wheel so they are correct. Then look at the stem, which is the part that connects the handlebars to the frame. On the top of it you should see a bolt, and you need to tighten it. This should fix your problem.