If barretts esophagus is precancerous how do they detect when it become cancer?

Upper endoscopy. Serial upper endoscopy is needed to follow up baretts esophagus as it can develop into esophageal cancer. If there is any significant change or growth on those serial egd- a biopsy will be done to confirm/ rule out cancer.
EGD. By doing biopsy while doing egd (scope you throat and stomach).