Albus Dumbledore obtained the Elder Wand by defeating Gellert Grindelwald in a legendary duel in 1945. Grindelwald had previously stolen the wand from the wandmaker Gregorovich and used it during his dark reign. When Dumbledore confronted and defeated Grindelwald, the wand's allegiance passed to him as its rightful new owner
. The Elder Wand's ownership is transferred through defeat, typically in combat. Dumbledore's victory over Grindelwald ended the latter's possession of the wand and established Dumbledore as its master. This duel was a pivotal moment in wizarding history, marking the end of Grindelwald's tyranny and the beginning of Dumbledore's stewardship of the wand
. In summary, Dumbledore got the Elder Wand by winning a duel against Grindelwald in 1945, thereby claiming the wand's allegiance through his victory