Any way that they don’t wind up dead is the right way, you can fix nearly anything else. Personally, I think they know more about being a chicken than people do. If mine wanted out, I would let them out.
Just let them out into the run during the day time, the run being the outside fenced part, you generally put them in the coop at night, ( a little confused with your post?) just before dark make sure they are all in the coop, lock it up, in morning let them out. Night go lock them up again. When they are already in the coop before you get there, they have it figured out.
Now if you want free range them, wait till they have been in your coop/run set up for a while, and then let them out of that in the late afternoon,leaving an opening to the coop. Again, check just before dark, but they should be right where you want the,.