Aerosol research is important for the protection of the ecological environment, the improvement of air quality, and as a response to climate change. In this study, a random forest (RF) estimation model of aerosol optical depth (AOD) and extinction coefficient vertical profiles was, respectively, established using Orbiting Carbon Observatory-2 (OCO-2) oxygen-A band (O2 A-band) data from China and its surrounding areas in 2016, combined with geographical information (longitude, latitude, and elevation) and viewing angle data. To address the high number of OCO-2 O2 A-band channels, principal component analysis (PCA) was employed for dimensionality reduction. The model was then applied to estimate the aerosol extinction coefficients for the region in 2017, and its validity was verified by comparing the estimated values with the Cloud-Aerosol Lidar Infrared Pathfinder Satellite Observations (CALIPSO) Level 2 extinction coefficients. In the comprehensive analysis of overall performance, an AOD model was initially constructed using variables, achieving a correlation coefficient (R) of 0.676. Subsequently, predictions for aerosol extinction coefficients were generated, revealing a satisfactory agreement between the predicted and the actual values in the vertical direction, with an R of 0.535 and a root mean square error (RMSE) of 0.107 km−1. Of the four seasons of the year, the model performs best in autumn (R = 0.557), while its performance was relatively lower in summer (R = 0.442). Height had a significant effect on the model, with both R and RMSE decreasing as height increased. Furthermore, the accuracy of aerosol profile inversion shows a dependence on AOD, with a better accuracy when AOD is less than 0.3 and RMSE can be less than 0.06 km−1.