presence of mind

Noun
  1. self-control in a crisis; ability to say or do the right thing in an emergency
presence of mind
She kept her presence of mind and calmly applied first aid to the injured hiker.