Learning in Science, Technology, Engineering, and Mathematics (STEM) is challenging, leaving many students to give up on these subjects. Specifically, females are underrepresented in STEM industries. Identifying how male and female students deal with STEM learning challenges, and how this relates to learning outcomes, may inform teaching that best supports the preferences of individual students.This study asked secondary school students, who had just completed a STEM lesson that they reported as finding difficult (n = 3758; male = 51.2%), to write narratives about how they dealt with the lesson. Narratives were analyzed using a linguistic text analysis program to identify core psychological processes contained within the narratives from lessons in science n = 1305 (males = 46.3%), technology n = 589 (males = 63.7%), engineering n = 202 (males = 57.9%), and mathematics n = 1662 (males = 49.9%). Students were also asked to score how well they think they did in the difficult lesson (learning outcome). Pearson's correlations between students' use of core psychological processes and their perceptions of lesson success were computed separately for males and females. Common strategies emerged across the STEM subjects: for female students, positive learning outcomes were associated with positive emotions, social processes, rewards, and strategic thinking. For male students, positive learning outcomes were associated with motivation around the risk of failing, rationalizing the problem, and strategic thinking. Negative emotion was associated with a negative learning outcome for both broadly defined genders, but this was more evident across the subjects for females. We specify our understanding of this strategy by reporting data separately for the STEM subjects and the implications for STEM pedagogy.