We best undermine dictatorships by preserving and, when possible, building an ever stronger functional democracy. So our very existence may serve as a model, and we might furnish the world with an example.
In addition, protecting rights to freedom of belief, freedom of expression, etc. and integrating any dictatorships into the "free world" so their leaders and their people are exposed to different ideas and the nonviolent debate/exchange of ideas.
Also, many have forgotten that the original purpose behind public education was to create an informed voting citizenry. Not to get people ready for factory jobs, or STEM jobs, or whatever. To have informed voters, in order to have a functioning democracy.