How long have you had them? I would entice them with treats (as mentioned above) to go into their coop before it’s dark and lock them in. I try to get my girls settled in before dusk. That way they are locked away at dark.
I take some dried meal worms and a little cracked corn put it in a plastic container so that when I shake it it rattles. I then say, “chick, chick” (original, right? Ha). Anyway, I treated them before I had them go into areas where I wanted them so that they learned that when I do this, they get a treat. Of course, they have learned to recognize the plastic container and now jump up to it to try to get a treat. I don’t treat them when they are being bratty.