Robert Heinlein proposed something like that in his "lost" novel For Us, the Living: instead of declaring war, Congress would authorize a war referendum, in which only those eligible for military service could vote. The catch was, everyone voting "Yes" would thereby automatically sign themselves up in the military for the duration. If a further draft was needed, it would first be composed of those that didn't vote, and lastly those who voted "No."
(In the book, the "future" Congress had called war referenda on three occasions; each time, the vote was overwhelmingly "No," and historians believed those decisions were justified.)
Simpler: Leaders who engage in military engagements should face a public referendum 6 months/1 year later, with exactly 1 question: "Should [Leader] die?". Presidents in the US rarely get elected with less than 40% of the popular vote, and I reckon about 30% of people wouldn't vote to kill someone pretty much no matter what they did. Half of those people are your supporters, so really it's just a matter of avoiding your popularity plummeting to sub 35% because of your warmongering. By that math. By that math, Trump, W. Bush, and Truman would have gotten the gallows. Biden, Carter, and Nixon all fell below 35%, but didn't start any foreign wars.