Many things can occur when the ball goes out of bounds...
(1) If the ball goes over a side line last touched by an attacker, the defense receives a throw-in.
(2) If the ball goes over a side line last touched by a defender, the attacker receives a throw-in.
(3) If the ball goes over a touch line (not between the goal posts and under the crossbar) last touched by an attacker, the defense receives a goal kick.
(4) If the ball goes over a touch line (not between the goal posts and under the crossbar) last touched by a defender, the attacker receives a corner kick.
According to FIFA Laws of the Game. Youth rules may be modifided.
Chat with our AI personalities
If the ball goes out of play on the sidelines, then the team who did not kick the ball out of play goes to throw it back in to their teammates. If the ball goes out of play on the goal-lines, and it was an opponent who kicked it out, then its a goal-kick. If it was an opponents side of the field, then it will be a corner kick.
It is a throw in given to the opposite team of those who kicked it out of bounds.
If it goes out on the endline or by the goal it's either a corner kick (kicked out by the defending team) or a goal kicked (kicked out by the attacking team)
usually the ball boys give the goalie another ball for a goal kick then they go chase he ball that went out.
The game is then restarted with a goal kick or corner kick. It is impossible to tell which. You did not specify which goal line it crossed or who "opponent" was.
It would depend on whether the opponent was the attacker or defender of the goal line in question.