You need a three-way switch, sized to the same size as your service.
https://www.homedepot.com/p/GE-200-Amp-240-Volt-Non-Fused-Emergency-Power-Transfer-Switch-TC10324R/100150463
Or you can setup a sub-panel for your "essential" circuits and go with a smaller three way switch
https://www.homedepot.com/p/GE-100-Amp-240-Volt-Non-Fused-Emergency-Power-Transfer-Switch-TC10323R/100171587
You then connect a Receptacle to the generator side of the transfer switch and the main power to the "line" side. The center is connected to your loads.
When the power goes out, plug in the cable to your generator, start it up, THEN move the transfer switch to generator.