My chickens keep getting eaten by foxes. What should I do?

Buy a coop for your chickens and put your chickens into their coop at night. Build a fence around the coop so that the foxes cannot enter the coop. Examine the coop and the fence for any holes that foxes can use to slip in and patch up any of these holes.