Below code is an simple example of what you described, each button will turn on the relays defined for them and turn off other relays. except for button 4 which will toggle relay 1 and 4.
int relay1 = 2;
int relay2 = 3;
int relay3 = 4;
int relay4 = 5;
int sw1 = 6;
int sw2 = 7;
int sw3 = 8;
int sw4 = 9;
int sw1Status, sw2Status, sw3Status, sw4Status;
Finally, I found it!
Do NOT try to drive a simple relay from an MMU like a ESP8266, Arduino, or Pi. That would likely destroy the digital pin on the MMU, and might destroy the whole processor.
You want a "digital relay module" which has a driver circuit to control the relay, plus some form of isolation to protect the digital pins.
A relay like this would be perfect: https://...
Voltage is only part of what a relay uses. Check the current requirements for the relay coil/input as well.
For example the common result for "3V relay arduino" will produce results for relay MODULEs that contain something akin to a SRD-03VDC-SL-C relay (labeled on the relay itself). Spec for the RELAY (separate search by relay part no) yields a data ...