Why do we use microwaves in microwave oven?
In microwave ovens what matters is how much energy the radiation carries and how that energy is absorbed by the food. Visible light and IR are rapidly absorbed by most foods, so they would only heat the outer layer of the food. You'd get food with the outside carbonised and the inside raw.
Microwaves are far less strongly absorbed by foods, so they penetrate deep into the food and can heat the interior. Even so large objects won't be heated throughout, which is one reason why microwave cooking instructions frequently advise a multi stage process of heating, letting the food stand then heating a final time.
Microwave ovens often include IR heating as well as the microwave heating. This is done so you get food with a browned exterior and heated throughout.
The answers to Why do microwave ovens use radiation with such long wavelength? give a nice discussion of why the exact wavelength used was chosen. The frequencies commonly used in microwave ovens are 2.45 GHz (12 cm) for home ovens and 915 MHz (38 cm) for industrial overs. Much higher frequencies are not used due to the cost of the magnetron, while much lower frequencies would not work because the wavelengths would be too big to allow a half wavelength to fit in the oven.
Finally, you say:
Why do we use microwaves in microwave oven when infrared and visible light are much hotter and how do microwaves cook food when they are cooler than visible light and others.
But this is a slight misunderstanding. The wavelength of light emitted is indeed related to the temperature of the source, but light itself doesn't really have a temperature in the sense that matter does. Light transfers energy, and if this energy is absorbed it will heat the food. However the amount of heating is just related to the intensity of the EM radiation and the abosrption cross section. The wavelength makes a difference only insofar as it affects the absorption cross section.
As @john-rennie have state out. Shorter wavelength tend to absorb and heat the outer layer of object. Microwave using long wavelength to penetrate to inside and also it use the property of dipole moment of water molecule to heat things, not directly heat by let object absorb energy
If we just use short wave then you can only get burnt outside and raw inside