A four-sided fence with self-closing, self-latching gates is considered the best barrier. The fence should be at least 4 feet high and designed to be climb-resistant.