The full offence, as stated in the Laws of the Game, is "denying an obvious goal scoring opportunity to an opponent moving towards the player's goal by an offence punishable by a free kick or a penalty kick." This long phrase has many important components that must coincide.
The first keyword there is "obvious." This one word is the distinction between this offence being cautionable or worthy of an expulsion. If a player does not have an obvious goal scoring opportunity, then the opponent is only guilty of breaking up a promising attack. The next key phrase is that the player must be moving towards the goal. In other words, the direction of play is important. This means that if a player is moving away from the goal and the last defender tackles him, the referee is unlikely to consider that an obvious goal scoring opportunity.
The third critical phrase there is that the offence committed must be punishable by a free kick or penalty kick. In other words, the offence must be one of the ten offences that incur a direct free kick. However, Law 12 specifies that if a player denies an obvious goal scoring opportunity by playing in a dangerous manner (indirect free kick), then the referee should send off the offender.
In assessing whether the conditions have been satisfied, the referee should use certain criteria. The primary criteria can be classified as the "Four Ds." The first D is distance, followed by direction (of play), defenders (location and number), and derriere (whether the offence was committed from behind). In addition to these criteria, the referee should also consider whether the player was in possession of the ball or had the opportunity to gain possession of the ball.
When considering the distance, one must look at how far away from goal the offence was committed. An offence committed outside the "attacking third" is not typically obvious - just promising. Of course, there are situations where this rule is not absolute. With the direction of play, the referee looks at an imaginary field that surrounds the goal to determine whether play was in its direction. The proximity and number of defenders is also a critical factor, since if another defender is around, the offence is likely to be a cautionable one - even if it occurs in the penalty area.
When deciding to send off a player under this offence, the referee has to look at the intersection of criteria and ensure that all of them are satisfied at a minimum.