It's not a science, but more like an art.
Step One: First you have to get all of your food together: the freeze-dried dinners, the soup packets, the instant oatmeal and cocoa, the energy bars and the gorp, the dried fruit and salami, bread or crackers. It all has to go into that little plastic barrel.
Step Two: Take everything out of its pre-packaged wrapper. Pour the freeze-dried dinners into zip-lock bags, so they take up less room. Open the dried fruit packages, squeeze all the air our of them, then re-seal them with their finger seal. Remove all extraneous paper wrappings, cardboard, etc. If you are taking bread, squeeze it down into a much smaller dimension, and then put it in the freezer over night. It will take up less room, and stay fresher that way.
Step Three: take the first night's dinner and set it aside. It doesn't have to go in the can, nor does the first day's lunch or snack. Whew! That makes it a little easier.
Step Four: imagine all of this fitting into that little plastic can. And imagine how you are going to use this stuff. Start by putting a couple of days' breakfasts and dinner down into the bottom of the can. You won't need these for the first few days, and it's better to get them out of the way.
Step Five: Now stack all those energy bars around the side of the can. This is the most efficient use of space for these bars, and this way they are more or less easy to grab. As you stack them in there, use more breakfasts or dinners to hold them in place.
Step Six: now it's time for the stuff in the middle. Take your salami, cheese, and anything else you are going to eat for lunch and pack it in the middle of the can. You'll need to access this stuff every day, so there is no point putting it in the bottom.
Step Seven: Toss in the last breakfast--that's what you'll need first thing in the morning on the second day, and it makes sense to put this on top. Hooray! It all fits perfectly!
Step Eight: Inform your wife that the bear canister is now packed for the trail. She asks if you want to put the toiletries in there as well.
Step Nine: Take the sunscreen, moisturizer, insect repellent, toothpaste, and face cream from your wife. Go back to the bear can and start shoving it in. With a little bit of luck and some brute force, you'll be able to wedge this stuff in between the salami and the cheese, and maybe shove one down the side with the energy bars. That last tube of face cream is just going to get mashed on top...and let's hope it doesn't jam the lid when you try to unscrew everything.
Step Ten: Inform your wife that the bear canister is now packed for the trail. She asks if you remembered the bread.
Step Eleven: Take the bread out of the freezer. Unpack the entire can and start again, shoving things together even harder. Forget trying to keep the noodles in once piece. Sacrifice the crispy crackers and turn them into powder to gain more space. Mash the bread into a solid ball, then shove the final toiletries on top and jam the lid in place. Slowly screw the lid down, listening for structural failure in the bear can.
Step Twelve: Inform your wife that the bear canister is now packed for the trail. She asks if you remembered to put the soap in.
Step Thirteen: Put the soap in a side pocket of your pack, along with the last two energy bars, a tube of neosporin, and the raisins your wife just bought at the store.
Step Fourteen: Inform the ranger at the trailhead that all your food and odorized items are in the bear can.
Step Fifteen: Start hiking. Hope for the best. Inform your wife that next time, we'll have take less stuff.