The proper way to do it involves a transfer switch or breaker box interlock & a male inlet connector. Here is one set of equipment to accomplish that:https://www.amazon.com/Manual-Transfer-Switch-125-250V/dp/B09WXJYQ11
edit: There's a reason you call your way "suicide".