When turning in for the night, there's no need to hang your food from a tree branch away from your tent; there are designated metal food storage bins at each campsite that seal food inside, minimizing their odor. (If not, store food in your car.) This goes for everything that can smell like food, including used napkins or candy wrappers. Do not drain anything (i.e. pasta) onto the ground near your campsite; pour any food-smelling liquid into a plastic container or bottle and store it along with your food. Do not wash your dishes near the campsite; water mixed with your sauce or food scraps is an odorous giveaway of your presence. Instead, there is a usually designated dishwashing sink near the toilets, with a drain that moves that dirty water away - if not, you'll have to wait for a place that's safe.
While these ideas may seem like a hassle, they are definitely necessary when cooking out in Yellowstone, for your sake and the sake of your fellow campers. Also, it should go without say that you should remember to extinguish your campfire before turning in too; you may not be able to prevent a bear from entering your camp, but - as we've heard for years (from ironically a bear) - only you can prevent forest fires.