There's no one way to pack a backpack -- everyone will pack their backpacks differently. But some general guidelines will make it easier for you to access the things you need when you need them. They'll also make your pack easier to carry over a long day.
When you're packing a backpack for a trip where you'll cover moderate terrain and remain on the trail, it's best to pack the lighter items in the bottom of the pack and heavier items toward the top. This keeps your center of gravity relatively high, which many people find makes the weight easier to manage. The heavier items should be packed closest to your back.
If you plan to hike rough terrain or off-trail, try arranging some of your heavier items in the bottom of your backpack. This lowers your center of gravity, which will improve your balance. Because women naturally have a lower center of gravity, they often prefer to pack their backpacks this way for all trips.
Many backpacks have a separate compartment for sleeping bags. If your pack doesn't, pack the sleeping bag in the bottom of the pack. This will keep it out of the way during the day, and you're unlikely to need it until you stop for the night. Once you have a home for your sleeping bag, slip your tent under the bag. Use straps to connect your tent poles to the outside of the backpack.
Pack your changes of clothes toward the bottom of your backpack, because, like your sleeping bag, you won't need them until you stop for the night. If you're hiking in changeable weather, stash rain gear, gloves or hats in the top of your backpack or in an outside pocket, where you can reach them quickly and easily.
Food and cooking fuel are two concerns for many hikers. They're both heavy, so you don't want to take too much of either, but you certainly want to have enough. Plan your meals before your trip to make sure you pack enough food. Practice using your stove before your backpacking trip as well, so that you know approximately how much fuel to pack.