The COVID-19 pandemic accelerated the adoption of online learning, particularly in higher education institutions. This shift underscores the importance of sustainable education practices aligned with the United Nations’ Sustainable Development Goals (SDGs). SDG 4 emphasizes inclusive and equitable quality education, highlighting how online learning environments can enhance accessibility and flexibility for students worldwide. SDG 9 underscores the role of technological advancements in education. SDG 10 focuses on reducing inequality within and among countries, and online education can bridge educational disparities by offering flexible learning options to diverse socioeconomic backgrounds. SDG 17 emphasizes the importance of partnerships, which have been crucial in developing effective online learning solutions. This study investigates the relationship between undergraduate students’ self-regulated online learning, perceived flexibility, and attitudes towards the use of distance learning environments at a state university in İzmir, Türkiye. Utilizing a survey-type correlational research model, data were collected from 300 undergraduate students. The results indicate that undergraduate students exhibit high-level self-regulation, perceive moderate flexibility, and hold positive attitudes towards the use of distance learning environments. The analysis showed that self-regulated online learning is moderately correlated with perceived flexibility and strongly correlated with attitudes towards the use of distance learning environments. These findings suggest that both perceived flexibility and positive attitudes towards the use of distance learning environments play important roles in predicting self-regulated online learning. This research provides valuable insights for educators and institutions aiming to enhance the online learning experience by promoting self-regulated learning behaviors and flexible learning environments.