To regain control of your emotions and behaviour, especially after something upsetting.
"She took a few deep breaths and told herself to pull together before walking back into the room."
Pull yourself together.
— Commonly attributed to Basil Fawlty, Fawlty Towers (BBC TV series, 1975–1979)