The sidelines and baselines make up the boundary lines on a basketball court. A player is out-of-bounds if he steps on or crosses the boundary lines with his feet or touches any object that is out of play.
The rules of out-of-bounds and the boundary lines in basketball can be confusing, but are similar at all three levels of play (high school basketball, college basketball, and the NBA). We've simplified the rules for beginners below with this complete list. If you're ever in doubt, read these rules.
While the ball is in play, possession can change fluidly, meaning that a team can steal the ball and it's theirs. However, if the ball happens to go out of bounds by any means, then the team that touched the ball last surrenders possession to the other team.
Throw-ins, also known as inbound passes, are used to put the ball into play after the ball goes out of bounds. The referee will award the ball to the team that gets possession at the nearest sideline spot. On a throw-in, the thrower stands out of bounds and passes the ball to a teammate who is inbounds. They must keep both feet planted until the ball is released from their hands. A defender usually tries to block inbounds passes. Teams will generally assign someone very tall to guard inbounds passes as it makes it difficult to pass the player with the ball.
Whenever the referees cannot figure out which team caused the ball to go out-of-bounds, a jump ball will be used to put the ball into play. This is only when video review proves inconclusive and jump balls are usually a last resort. Teams will let their tallest player take the jump ball. For a jump ball, a referee throws the ball in the air and two players jump and try to deflect it towards their teammates. Jump balls are considered a fair way to decide which team get possession. Jump balls also occur at the beginning of games.