"if the oven is hot then you may put the cake in". This the premise.
Now, The necessary condition will be "If the oven is hot" meaning the cake can be put inside the oven only when the oven is hot and not otherwise. So, here the hotness of the oven becomes the necessary condition.
"Oven is hot" is the necessary condition "to put the cake in"