It is not painful. Surgery is usually done under local anaesthetic with additional intravenous sedation if needed.
Local anaesthesia will stop the eye muscles from moving. You will feel relaxed and drowsy and won’t feel any pain or discomfort during the surgery.