We focus on optimizing spectrum usage in 7G and beyond, addressing critical challenges such as spectrum scarcity, interference, and dynamic allocation in highly congested wireless environments. Leveraging advanced techniques, including machine learning, signal processing, and stochastic optimization, our research develops real-time solutions for spectrum analysis and efficient spectrum sharing. By exploring sub-6 GHz, mmWave, and THz frequencies and leveraging 3GPP-defined standards, we aim to maximize spectrum utilization and ensure adaptive resource allocation. Our work ensures improved signal quality, enhanced network throughput, and robust communication for IoT, smart cities, autonomous systems, and next-generation applications. This research supports the sustainable evolution of wireless networks, enabling high data rates, ultra-reliable, low-latency communication, and seamless connectivity.