Typically, you are not going to physically move a switch electronically or remotely... The "real switch" is going to be a relay that's controlled by pushing/moving a switch or under software/automatic control. Once you've got a relay connected to a microcontroller, any number of things can control it!
So, now we need to think about the logic... Usually, you don't want to use a regular toggle switch because the toggle switch may be in the on position after the microcontroller has turned it off (or vice-versa).
One option is to have an "on" button and an "off" button (momentary switches). Or, you can find momentary center-off toggle switches that spring-back to the center.
Or, you can have a single momentary button that the software senses and toggles (changes state) every time you press it.
Or, you can create an "or condition" arrangement, where either the switch or microcontroller can turn the relay on, and unless both are off, the relay stays on.
Or, you can use a toggle switch that works like a "3-Way" switch in a house... Sometimes up is on, and sometimes up is off, depending of the state of the other switch (r the state of the microcontroller). That can be done in software so you don't need a double-pole switch like you'd use for a 3-way light switch.)