The integration of AI and the IoT in education has the potential to revolutionize the way we learn. Personalized learning, real-time feedback and support, and immersive learning experiences are some of the benefits that AI and the IoT can bring to the education system. In this regard, this research paper aims to investigate how AI and the IoT can be integrated into sustainable education in order to provide students with personalized and immersive learning experiences during pandemics, such as COVID-19, for smart cities. The study’s key findings report that AI can be employed in sustainable education through personalized learning. AI-powered algorithms can be used to analyze student data and create personalized learning experiences for each student. This includes providing students with tailored content, assessments, and feedback that align with their unique learning style and pace. Additionally, AI can be used to communicate with students in a more natural and human-like way, making the learning experience more engaging and interactive. Another key aspect of the integration of AI and the IoT in education obtained from this research is the ability to provide real-time feedback and support. IoT-enabled devices, such as smart cameras and microphones, can be used to monitor student engagement and provide real-time feedback. AI algorithms can then use these data to adapt the learning experience in real time. IoT-enabled devices, such as tablets and laptops, can be used to collect and process student work, allowing for the automatic grading of assignments and assessments. Additionally, IoT technology can facilitate remote monitoring and grading of student work, which would be particularly useful for students who cannot attend traditional classroom settings. Furthermore, AI and the IoT can also be used to create intelligent personal learning environments (PLEs) that provide students with personalized, adaptive, and engaging learning experiences. IoT-enabled devices, such as smart cameras and microphones, combined with AI-powered algorithms, can provide real-time feedback and support, allowing the PLE to adapt to the student’s needs and preferences. It is concluded that integrating AI and the IoT in sustainable education can revolutionize the way people learn, providing students with personalized, real-time feedback and support and opening up new opportunities for remote and disadvantaged students. However, it will be important to ensure that the use of AI and the IoT in education is ethical and responsible to ensure that all students have equal access to the benefits of these technologies.