IFAB Laws of the Game 2021-22
Law 17: The Corner Kick
"A corner kick is awarded when the whole of the ball passes over the goal line, on the ground or in the air, having last touched a player of the defending team, and a goal is not scored.
A goal may be scored directly from a corner kick, but only against the opposing team; if the ball directly enters the kicker’s goal a corner kick is awarded to the opponents."
I love the second part of the above!