How can I change whole site color with toggle a button

Thanks J.D. for your response could you kindly inform me what to add in red option of the code please?
as for this “you keep the mode in the session/locale browser cache and apply it on page load”. I didn’t get it could you kindly elaborate it please?

Thanks