Stripping the ball
A defensive player who is able to strip the ball very simply is either to slap it away from the control of an offensive player or is able to take away control of the basketball with two hands. This most frequently happens on the perimeter if a player is too careless with protecting the ball or places it out front of them. Stripping the basketball is also a great option in transition or in the post for shorter players who are not shot blockers.
On the Perimeter
Stripping the ball on the perimeter requires quick hands and being able to anticipate the movement of the basketball in an offensive player's possession. An offensive player may place the ball in front of them or dribble the ball too far out in front allowing the defender to use active hands to deflect or strip the basketball away. Many players utilize a technique where you swipe at the ball by coming palm up from underneath the ball. Reaching in and slapping down often receives a whistle from the referees, but deflecting it from underneath often makes any contact go unnoticed.
In the Post
For shorter post players guarding a taller offensive player on the block a useful tactic is to wait for the point where the offensive player brings the basketball down to waist level to gather momentum to go up to the rim. Practice and hand speed may allow you to stop a shot attempt by stealing the basketball when the player brings it down instead of trying to most likely unsuccessfully block a shot attempt which usually ends up in a foul.
For players who are not shot blockers the best option available in a one on one fast break situation is to try to take an angle where they can strip the basketball from the offensive player's hands as they are in their motion to attack the basket. Often the defense can create a turnover as this strip will often cause the basketball to bounce off the offensive player's torso or legs and go out of bounds. At the worst, if you end up fouling the offensive player you prevent the possibility of an And-1 by not allowing the shot attempt.
The Dig Out
A strip can also come off what's referred to as a dig or dig-out. An offensive player receives the ball in the post or in a position to score particularly with their back to the basket. A perimeter player leaves their assignment to come down and attempt to strip the ball. The player attempting to dig must be aware of the quality of the offensive threat the player they are leaving alone presents. You don't want to leave a lights out shooter alone but if you are guarding a pass first point guard it may not be a bad idea to help dig down into the post. Below is an example of Jeremy Lin doing just that leading to a transition opportunity.