Here is the context:
Whether you believe that partners should or shouldn’t disclose everything, it’s probably safe to say that good reactions tend to encourage more discussion and more disclosures. This is easy to say, but sometimes really hard to achieve, which is why it drives personal and relationship growth. It’s that parallel process of learning how to feel confident in our own desires, regardless of our partner’s reactions, while also being able to manage our own reactions to our partner’s desires. If we can both keep our heads on in these sensitive moments, we will be better able to understand each other’s positions and why we each feel that way.
I am aware of the phrase keep one's head meaning to stay calm. But I am not really sure what keep one's head on in means there.