Hello Barbara,
In-flight emergencies can take many forms. They may be a mechanical problem, disruptive passenger, a medical emergency, etc. The vast majority of issues are handled with methodical use of checklists, standard procedures, and reliance on extensive training. The confidence in which a pilot handles an emergency is a direct result of their quality training and experience.
Great question. Thank you for asking.