collect (oneself)
To compose oneself so that one's actions are not dictated by one's emotions. I know you're angry, so you need to collect yourself before you go in there and say something you'll regret to your boss.
collect one's thoughts
Fig. to take time to think through an issue; to give some thought to a topic. I'll speak to the visitors in a moment. I need some time to collect my thoughts.
collect yourself/your thoughts
1 try to control your emotions and become calm: I’m fine — I just need a minute to collect myself.
2 prepare yourself mentally for something: She paused to collect her thoughts before entering the interview room.