Endoscopy means to look inside. This often means looking inside the body for medical reasons with an endoscope.
An endoscope is a medical instrument that is made to see parts inside a patient's body. This has the advantage that observations and certain operations can be done without opening up the body. Whatever precautions are taken, an open body part is always at risk of infection.
The endoscope has a long tube to enter the patient's body and a tiny camera or lens attached to the front of this tube. Sometimes the tube is guided through the body using outside imaging.
It is usually inserted into patient's nose, mouth, or anus, so surgeons can see what is there. If necessary, action can be taken, like getting a tissue biopsy.