Altitude sickness can usually be prevented by ascending slowly. It is essential to give your body enough time to acclimate or get used to the high altitude environment. In most cases, the symptoms are temporary and would lessen once the body acclimates. Avoid strenuous activities. Do not consume cigarettes and alcohol. Drink plenty of fluids and stay hydrated. Avoid sodas and gas-producing foods may also lessen the symptoms.
Most climbers and high-altitude trekkers use the “climb-high, sleep-low” method, which gives the body more time acclimate to the high altitude environment. 
Bringing oxygen cans or tanks or pressure bags (Gamow bag) as a precautionary measure. Drugs such as Diamox, or acetazolamide, Dexamethasone and Nifedipine have proven to be effect in preventing altitude sickness.