Allopurinol is a medication primarily used to treat gout and hyperuricemia. It works by inhibiting the enzyme xanthine oxidase, which is responsible for the production of uric acid. By lowering uric acid levels, allopurinol helps to prevent gout attacks and reduce the formation of urate crystals.