Two broad types of surgery exist, depending on your diagnosis.
Elective surgery
An elective surgery doesn't always mean it's optional. It means that the surgery isn't an emergency and can be scheduled in advance. It may be a surgery you choose to have for a better quality of life, but not for a life-threatening condition. But in some cases, it may be for a serious condition, such as cancer. Examples of elective surgery include removing a mole or wart and having kidney stones removed. It may also be done if other forms of treatment aren't working.
Urgent or emergency surgery
This type of surgery is done because of an urgent medical condition that needs attention right away. The condition may even be life-threatening. Examples are acute appendicitis and trauma.