After the ice storm a few years ago we bought a generator and hired an electrician to set it up. He wired it into the breaker box and has a box on the back of our house so if the power goes out we can move the generator to the box, throw the electric input main breakers (so we can’t accidentally kill power line repair men), pull the connecting cord out, plug in the generator and fire it up. Our generator is not big enough for the whole house at once so we have to selectively control other breakers.
Having it done by a qualified person is a must and can keep you from killing someone.