Well,there are a couple of things which you can do in order to ensure that you will not waste any food you buy.
some tips of planning to prevent wastage of food are:-
(1)Firstly think how much you eat and therefore ,how much you might need.
(2)Prioritize what you eat,start with the stuff which due date is the shortest on coming.
(3)If you cannot eat somthing ,share with your flatmates or invite your friends.
(4)If you cannot do what's been written in number 3 you can freeze(as long as none of ingredients)
(5)Always segregate your organic waste so it would not go for nothing when you throw it away