Free-space optical (FSO) communication is an emerging technology that uses light waves to transmit data, providing a faster and more efficient alternative to traditional wired communication. However, FSO communication is susceptible to atmospheric turbulence caused by factors such as rain, snow, and fog. To overcome this challenge, this study employs artificial neural network (ANN) and long short-term memory (LSTM) models to analyze the impact of atmospheric turbulence on FSO communication. The results indicate that higher wavelengths experience less attenuation than lower wavelengths in the presence of fog. The use of ANN and LSTM models to analyze the attenuation of various wavelengths in the presence of fog has shown that higher wavelengths experience less attenuation than lower wavelengths. Additionally, the LSTM model outperforms the ANN model in handling atmospheric turbulence, with an accuracy of 64.68 % compared to 63.98 %. These findings highlight the need for adaptive networks that can quickly adjust to traffic situations while being cost-effective. As the fiber optics industry continues to expand and evolve, there is potential for further developments in optical communications that prioritize speed, efficiency, and flexibility. As technology advances, the pursuit of faster and more reliable communication will continue to drive innovation in this field.