This paper explores the concept of smart cities and the role of the Internet of Things (IoT) and machine learning (ML) in realizing a data-centric smart environment. Smart cities leverage technology and data to improve the quality of life for citizens and enhance the efficiency of urban services. IoT and machine learning have emerged as key technologies for enabling smart city solutions that rely on large-scale data collection, analysis, and decision-making. This paper presents an overview of smart cities’ various applications and discusses the challenges associated with implementing IoT and machine learning in urban environments. The paper also compares different case studies of successful smart city implementations utilizing IoT and machine learning technologies. The findings suggest that these technologies have the potential to transform urban environments and enable the creation of more livable, sustainable, and efficient cities. However, significant challenges remain regarding data privacy, security, and ethical considerations, which must be addressed to realize the full potential of smart cities.