How do you create an electric fence?

You need an electric fence controller, first off. The purpose of an electric fence is to scare whatever touches it into staying away. If you try to make one by wiring it to mains power, you will just kill whatever touches it. You can get a controller at Tractor Supply Co.

After procuring a controller, running an electric fence is a simple matter of stringing wire on insulated posts. You connect the controller to your fence and ground, and there you have it.

Talk to the salesperson at the Tractor Supply store. They will have controllers, wire, insulators, posts that can be easily installed, gate handles, and whatever else you need.