A useful way to confirm an idiom's meaning is to picture its opposite first, since "keeping one's temper" is naturally opposed to "losing one's temper," and comparing the options against that contrast makes the right choice clear.
Testing each option against the natural opposite of "losing one's temper" leaves only "to be in good mood" as a genuine match.
Therefore, the correct answer is To be in good mood.
Poetic Devices: Identify the poetic device used in the following line: "The wind whispered through the trees."