Turn off the electricity at the main circuit breaker or fuse box.
Choose an empty circuit in your breaker box to begin your outside line. If your breaker box is on another floor or in an inconvenient location, establish a sub-breaker with a capacity of 20 to 40 amps on a wall where the outside line will leave the building. Although NM wire might be used indoors from the breaker box to the sub-circuit box or wall, once outdoors, use UF or other waterproof wire or other wire dictated by your local code. Install ground fault circuit interrupters, or GFCIs, at the indoor circuit breaker if required by local code.
Dig a trench along the proposed route of the line. Codes may require depths from 18 to 24 inches.
Lay UF wire in PVC or conduit in the trench with GFCIs along the line if required by local code. Cut conduit to size with a hacksaw and draw UF wire through, inserting connectors between straight and elbow sections as you work. Fasten PVC connectors with pipe adhesive. Anchor conduit that runs along walls every 6 to 10 inches with J-shaped pipe straps.
Terminate the line in a weatherproof outlet, switch or combination box in your shed. Use fixtures with GFCIs if required by local code.