Heparin is a naturally occurring anticoagulant used to prevent and treat blood clots in conditions such as deep vein thrombosis and pulmonary embolism. It is often administered intravenously or subcutaneously and works by enhancing the activity of antithrombin III, thereby inhibiting clot formation.