My cockerel has been a little jerk a few times, when he was around 5mos he peaked with attitude. I have had to (during the day) catch him twice, pick him up, and carry him around for all the hens to see. It put him in his place. Most of the time he's extremely calm and doesn't mess with me (he mostly just gives me my space, sometimes he'll come fairly close when I'm giving treats, but that's in a calm manner). At night I never have a problem, they go into the coop on their own and I just go out to check on them before I close the coop for the night (I open it right now at 6:30am and close it between 6-6:30pm). This morning he decided to be a little jerk. I went out and opened the coop at the normal time. I came inside and did morning chores, then I laid down for a little bit. I got up and the wind (which is whipping pretty strongly today) had knocked the coop door so it was closed 3/4 the way, 2 pullets were "trapped" inside while the rest were out with him. It ****** him off. So, I go into the run to open the door and he decided he was going to shake his leg at me (when he shakes the leg farthest from me it means he's about to charge toward me, if he shakes the one closest he's about to charge the other way, it's his way of saying "get out of my way or I'm going to bite/spur you). I don't tolerate that, so I quickly put him in his place.
He needs to know that you're not scared of him. I don't do anything mean, but I'm not afraid to catch and carry him around. I don't tolerate bad attitude/attack attempts from him, and I always keep my eyes on his general location because I don't want him creeping up for a potential sneak attack (I don't think he would, but you never know).