Yard lighting should not be powered by a random extension cord. It needs a properly planned outdoor electrical line with suitable cable, breaker, junction boxes and moisture protection.
The number of lights, cable length, installation route and control zones should be defined in advance. Outdoor connections must be sealed, and the line should have proper protection in the electrical panel.
If lights flicker after rain, breakers trip or leakage protection opens often, the cable, junction boxes and protection devices should be checked. The solution is to find the fault, not bypass safety protection.