Place all conflicting food items in a storage chest before preparing your dish. So, if you need to make fish and chips with a minnow, place every other fish you have, either in fridge or inventory, safely out of harms way in the chest. Your sim will then have only the minnow available.
Although that way works, there's no need for that much trouble.
The game chooses the ingredients in the following order:
1. What's in the cook's personal inventory, rather than inside the fridge;
2. the best quality item that fits the recipe;
3. The first item in the inventory (up and left).
To cook grape cobbler, for example, you must first buy or harvest the grapes, put it in the personal inventory of the cooking sim, putaway of it all fruit of better quality and then, finally, cook.
It seems more complex written than in practice.