At altitude there's less oxygen in every breath. Climb too high too fast, and the body can't adapt in time.
Acute mountain sickness starts above 2,500–3,000 m, with headache, nausea and fatigue, and is self-limiting. Prevent it by climbing at most 500 m a day and taking acetazolamide, which causes a metabolic acidosis that makes you breathe more. Above 4,000 m, HAPE (pulmonary oedema: breathlessness, cough, crackles) and HACE (cerebral oedema: headache, ataxia, papilloedema) can occur. The definitive treatment for all of them is descent; HACE also gets dexamethasone, and HAPE nifedipine.