Based on CGSS2021 data, the influence of social interaction on residents' pro-environmental behavior was empirically investigated using Ologit model, OLS model and causal mediated effect model. The results of the study show that social interaction has a significant positive effect on residents' pro-environmental behavior, and this facilitating effect is mainly generated through situational interaction channels, followed by endogenous interaction. Moreover, situational interaction has a positive effect on urban and rural residents' pro-environmental behavior, and endogenous interaction has a greater facilitating effect on rural residents' pro-environmental behavior, with no significant effect on urban residents. The existing research on the influencing factors of residents' pro-environmental behaviors was added to, and environmental knowledge was used to conduct a mechanism test to analyze the degree of influence generated in different areas of urban and rural areas. Based on the empirical research, it is suggested that the role of social interaction on environmental governance should be given full play, focusing on the differences between urban and rural areas, and utilizing the means of strengthening the publicity of environmental knowledge to promote the construction of a beautiful China.