IoT technology is used for making device will have sensing abilities like temperature, humidity, UV and would make a network of such other devices which will communicate with each other with such information and would take decisions, whether to switch on the fan or not, switch off lights, or unlock doors to make a toast based on a preprogrammed schedule or algorithm.
Machine Learning-It is a branch of AI which will take by using techniques of probability and statistical pattern of data to learn how to make decisions well based on experience.
If you are interested in IoT, I recommend this IoT Training course by Intellipaat.
Also, watch this video on IoT and ML: