Don't bury a regular extension cord.
Just don’t. A standard indoor/outdoor extension cord isn’t rated for direct burial — the insulation will degrade, water will get in, and you’re asking for a short circuit or a fire. If you absolutely must bury a cord temporarily, get a cord marked “direct burial” or “UF” (underground feeder). Even then, bury it at least six inches deep, run it through PVC conduit if you want extra protection, and never under concrete or heavy traffic areas.
But honestly, for temporary landscaping lights, the smarter play is to use low-voltage landscape lighting. It’s safer, cheaper, and the wire can be buried an inch or two deep with no risk. If you’re dead set on using a regular extension cord for a weekend, lay it on top of the ground and cover it with mulch or a rug — but don’t bury it. That’s the part that kills.