Just made a simple website having a button in the middle of the page, on clicking the button it turn the dark mode or light mode.
Basically Here I used the concept of 'EventHandler' in javaScript and 'toggle function' to toggle(add or remove) class having the dark mode theme .