With the spread of COVID-19 worldwide, online education is rapidly catching on, even in some underdeveloped countries and regions. Based on Bandura's ternary learning theory and literature review, this paper takes online learning of college students as the research object and conducts an empirical survey on 6,000 college students in East China. Based on literature review and factor analysis and structural equation model, this paper discusses the relationship among learning cognition, learning behavior, and learning environment in online learning of college students. The learning behavior includes interactive communication, self-discipline mechanism, classroom learning, and study after class. The learning environment includes teaching ability, knowledge system, platform support, process control, and result evaluation; learning cognition includes learning motivation, information perception, and adaptability. It is found that the learning environment has a significant positive impact on learning behavior, and learning cognition has a significant positive impact on learning behavior. It is uncertain whether the learning environment significantly impacts learning cognition. At the learning environment level, the teaching ability (0.59) has the most significant impact on the learning environment, followed by result evaluation (0.42), platform support (0.40), process control (0.33), and knowledge system (0.13). In terms of the influence on learning behavior, classroom learning has the most significant impact (0.79), followed by self-discipline mechanism (0.65), study after class (0.54), and interactive communication (0.44). In terms of learning cognition, information perception (0.62) has the most significant influence, followed by learning motivation (0.50) and adaptability (0.41). This paper suggests strengthening the construction of platforms and digital resources to create a more competitive learning environment. Improve process management and personalized online services, constantly stimulate students' enthusiasm for independent online learning, and cultivate students' online independent learning ability to promote the sustainable and healthy development of online education.