Instructions
Raise your gardening level to 21. You receive a garden size upgrade, giving you the largest possible garden.
Enter the village and go to Costolot's Store. Select the wooden fence from the available fence types, and then press the "A" button to place the fence in your garden.
Position the camera so that it's facing the Tower of Sour, which is to the right of a stone bridge and to the left of a path leading to a tunnel.
Place the first segment of fence just to the right of the stone bridge and as close to the white border denoting the edge of your garden as you can get it.
Place additional segments to the right of the first segment, creating a continuous row of fences stretching across the path to the tunnel. Use a total of eight to 10 fence segments.
Place one fence segment at a right angle at each end of the fence with the edges pointing toward the garden border. Professor Pester will walk up to the fence but be unable to pass it, eventually giving up and wandering away.