You have to introduce wall that the creature can’t crush through and can’t lift up to go under.
Goats are famous for staying their heads through the fence and regularly getting their horns hung up in the fence.
You require solid wall with secure entryways to contain these creatures.
They will regularly push against the fence like they are scratching their sides going back and forth so having your fencing material legitimately anchored to the fence-posts is imperative.