If you know the basics and comfortable with Maths, computing, probability, statistics, etc. You can go to Machine Learning since these are important for machine learning.
If you are good in communication protocols, embedded systems, system-level programming, programming with limited memory, battery, power, and processing requirements, etc, then you can go for IoT.
If you are interested in IoT, I recommend this IoT Course by Intellipaat.
Also, watch this video on IoT, ML, and AI: