It's a matter of keeping cool even when disheartened (7)

I believe the answer is:
control
'cool even when disheartened' is the definition.
I can't tell whether this defines the answer.
'it's a matter of' is the wordplay.
I cannot quite see how this works, but
'matter' could be 'co' (Co is an example) and 'co' is found in the answer.
'of' could be 'o' and 'o' is found within the answer.
'it' could be 't' (abbreviation. e.g. in 'tis) and 't' is found within the answer.
This may be the basis of the clue (or it may be nonsense).
'keeping' acts as a link.
Can you help me to learn more?
(Other definitions for control that I've seen before include "Regulation" , "Rule" , "Authority" , "domination" , "Regulate with self-possession?" .)
