Famotidine is used to treat ulcers of the stomach and intestines and to prevent intestinal ulcers from coming back after they have healed. This medication is also used to treat certain stomach and throat (esophagus) problems (such as erosive esophagitis, gastroesophageal reflux disease-GERD, Zollinger-Ellison syndrome). It works by decreasing the amount of acid your stomach makes. It relieves symptoms such as cough that doesn't go away, stomach pain, heartburn, and difficulty swallowing. Famotidine belongs to a class of drugs known as H2 blockers.This medication is also available without a prescription. It is used to prevent and treat heartburn and other symptoms caused by too much acid in the stomach (acid indigestion).    Source: https://www.webmd.com/drugs/2/drug-5035-2033/famotidine-oral/famotidine-oral/details