A hero/heroine is a character who, in the face of danger, displays courage, bravery, or self-sacrifice for the greater good.
The term hero/heroine usually refers to the main or principal character in a literary work, also known as a protagonist, but the first option has the most correct details.