As the demand for high-speed, low-latency communication continues to grow, free-space optical (FSO) communication has gained prominence as a promising solution for supporting the next generation of wireless networks, especially in the context of the 5G and beyond era. It offers high-speed, low-latency data transmission over long distances without the need for a physical infrastructure. However, the deployment of FSO systems faces significant challenges, such as atmospheric turbulence, weather-induced signal degradation, and alignment issues, all of which can impair performance. This paper offers a comprehensive survey of the enabling technologies, challenges, trends, and future prospects for FSO communication in next-generation networks, while also providing insights into the current mitigation strategies. The survey explores the critical enabling technologies such as adaptive optics, modulation schemes, and error correction codes that are revolutionizing FSO communication and addressing the unique challenges of FSO links. Also, the integration of FSO with radio frequency, millimeter-wave, and Terahertz technologies is explored, emphasizing hybrid solutions that enhance reliability and coverage. Additionally, the paper highlights emerging trends, such as the integration of FSO with artificial intelligence-driven optimization techniques and the growing role of machine learning in enhancing FSO system performance for dynamic environments. By analyzing the current trends and identifying key challenges, this paper emphasizes the prospects of FSO communication in the evolving landscape of 5G and future networks. In this regard, it assesses the potential of FSO to meet the demands for high-speed, low-latency communication and offers insights into its scalability, reliability, and deployment strategies for 5G and beyond. The paper concludes by identifying the open challenges and future research directions critical to realizing the full potential of FSO in next-generation communication systems.