Recent improvements in communication technology have undergone a significant shift over the last two decades, with state-of-the-art communication equipment, standards, and protocols simplifying the lives of consumers everywhere. For more than a decade, advancements in communication technology have mostly focused on increasing the speed with which information can be delivered and retrieved from anywhere in the globe at any time of day or night, regardless of location. Four-generation (4G) communication technologies, which have already been developed and implemented, are used to offer users with seamless access to multimedia content at transmission rates of 100 megabits per second (Mbps). It is becoming more vital to create new technologies in order to meet the growing need for faster speed as well as a variety of other advanced features. 5G networks have just recently been built as a result of extensive research and development. This has resulted in the gradual replacement of existing 4G services with new 5G networks, which are capable of transmitting multimedia content such as audio-video and high definition images, among other things, at data transmission rates in the gigabyte range or higher (up to several gigabits per second). Further recent development, in addition to the Internet of Things (IoT), which was made possible by future communication technology, is the Internet of Things-based social network. Aspects of this include the ability to connect and expanding Internet connectivity to all physical devices that consumers use to access common commercial and industrial services available on the Internet. In spite of this, with the advancement of existing high-speed communication networks, the effective interaction of devices with their inputs and responses via the Internet may be made possible through 5G Internet of Things networks. This new generation of automation and communication systems has emerged as innovative platforms for the next generation of automation and communication systems to be developed further in the future. M2M data may be utilised to more efficiently distribute resources if machine learning (ML) and optimum cell clustering are applied to the situation. It is because of this heterogeneity that the ML is able to make the best use of the remaining resources of the M2M network in order to optimise efficiency. Over the last several years, the shortage of radio frequency spectrum has proven to be the most challenging hindrance to wireless communication. This has occurred from the large number of high-frequency devices that need significant amounts of bandwidth allowance. Cognitive radio networks have been designed to meet this higher demand as a result of this increased demand.