For generator affiliation, a transfer switch or interlock at the panel avoids backfeeding the grid
https://www.designspiration.com/thankij61buhvu/
For generator interconnection, a transfer switch or interlock at the panel avoids backfeeding the grid, protecting utility workers and equipment securely.