Can you give us background? New ducks? New coop? Did they recently have trauma?
Generally, putting treats in the coop, and getting behind them (sometimes with a stick to make your arms look longer - not for hitting) and walking them in works.
They have been going in fine until 5 days ago wouldn't come out. I've actually caught them now and they're in safe gonna keep them in house with a run until they feel safe again
Please take a look around. They can know there is danger before we realize what's going on. Sometimes borrowing a game camera reveals some real surprises snooping around the coop at night.