When the ball's gone out of play, the line out is basically the way of getting it back in.
The line out needs to have at least two players from each team in it. The team who's throwing in will decide how many people it is – usually it's all the forwards.
Normally the hooker's the guy that throws the ball in. There's a skill to this – it needs to be dead straight or it's not fair.
Normally, the scrum-half will let the hooker know where the ball's going by shouting out a codeword. This is known only to the team, and simply lets the hooker know which player the ball's going to.