He committed suicide by taking poison
Himmler developed more psychosomatic diseases in the last several months of the war and was gradually pushed away by Hitler's gang. It was discovered in April 1945 that Himmler wanted to succeed Hitler and had arranged a surrender to the Western Allies with both the Western Allies and Swedish Greve (Count) Folke Bernadotte (to ally against the Soviet Union). Hitler swiftly ordered Himmler's arrest and removed him from all of his positions. Himmler attempted to flee while dressing like a regular soldier. He used poison to end his life while being held captive by the Western Allies.
Himmler was a brilliant administrator, a cunning and ruthless power-seeker, and he was slavishly loyal to Hitler up until the last few weeks of the war. As the main planner of the Holocaust, he blended a fondness for philosophical mysticism with a fanatical, cold-blooded dedication to Nazi racism. More than any other person, Himmler was the one who established the system of state terror through which the Third Reich quashed its critics, wiped out its internal rivals, and coerced German citizens to submit.