A throw in is taken from the point where the ball went off the court. It is out of court when it contacts anything outside of the court area (except the goalpost).
When taking a throw in, a player places their foot up to, but not touching, the sideline or baseline of the court. The lines are part of the court. If any part of your foot is touching the line, or you step onto the court in the process of taking the throw in, this is deemed to be a foul throw. This includes walking on the court to pass the ball to another player if you decide that they should take the throw in. In this instance, you should leave the ball on the floor outside the court for the player to then pick up.
You have 3 seconds from when you take up your position at the side of the court in which to throw the ball. You must also wait until all players are back on the court before taking the throw in. A player must not step behind any offside area whilst still in possession of the ball.
If any of the above occurs, the opposing team will be awarded a throw in.