How do you trap a garden snake?

For one, you probably mean, Garter Snake. Some may have a checkered blotched design on the length of it's back, and olive drab colored, while some will have some stripes (ribbons) the length of it's body. Ribbon snakes are related to Garters.

Two, they generally eat frogs, snails, slugs, fish or an occasional lizard. They will strike at you when cornered but seldom do any damage. Use gloves if you have to. Never catch a snake by the body for it will have its chance to bite. Place a hat or cloth directly over its head and most of the time they'll think they've hidden. Follow the body until you find it's neck. Then you can pick it up by the neck, gently but with enough pressure that it can't get away. It will musk you. One of the biggest muskers. But, if you want it they can make easy pets. Have plenty of water to swim in and fish are cheap.