Introductory computer science for non-majors, often referred to as CS0, is a course that is designed to be more accessible and less intimidating than CS1, with the goal of alleviating barriers and fears associated with learning computer science (CS). However, despite this intention, many students still struggle in CS0 and these courses do not always successfully prepare students for future CS learning experiences. In this paper, we study the experiences of CS0 students with a particular focus on the intersection of their metacognition, affect, and behaviors. To study students’ daily learning experiences, we collected data from 20 participants who completed structured daily diaries and retrospective interviews over the course of a single homework assignment. Through a thematic analysis of the diaries and interviews, we identified three distinct patterns of engagement that highlight the importance of metacognitive knowledge of strategies, or a students’ understanding of when, why, and how to effectively use regulation and disciplinary strategies while working on tasks. The three patterns of engagement include: (1) avoidance behaviors resulting from negative emotions, negative judgements, and a lack of metacognitive knowledge of strategies, (2) persistence or re-engagement behaviors despite negative emotions and judgements aided by metacognitive knowledge of strategies, and (3) persistence behaviors with evidence that metacognitive knowledge of strategies prevented students from forming negative judgements in the first place. We contribute an initial model of the interplay of metacognition, affect, and behaviors in CS learning, showing the role of metacognitive knowledge of strategies in helping students persist in the face of struggle. In our discussion, we advocate for explicit interventions that support students in developing metacognitive knowledge of strategies while also supporting their sometimes challenging emotional experiences.