PENALTIES:
The subject of penalties is a complex one, so we must be sure that we have a strong foundation on which to build. Keep in mind that I’m discussing the basic foundation for penalties, here; I’ll save spots and special enforcements for a later time.
Aside from the general analysis, every official calling a foul should instinctively know the “Four W’s”:
–who: the player's number and color;
–what: the foul;
–when: during loose or running play; and
–where: the spot of the foul.

Knowing each of these is absolutely necessary in order for the referee to determine the proper enforcement of fouls. The “when” is especially crucial when more than one foul has occurred, since enforcement may rely on the order in which the fouls occurred.

My most basic ‘quickie’ check is “Foul or fouls? Multiple or double? Enforce and decline options?” Of course, as each step is answered, the ultimate result may travel down any of a multitude of paths, and applicable rules may skip around the structure, depending on the situation. Assuming that enforcement includes the option to decline any or all fouls, the final analysis, in one fell swoop, looks something like this:
FOULS BY:
–one team:
       –single foul: enforce it.
–multiple fouls:
       –live-ball: enforce one chosen by offended team (10-2-3);
       –dead-ball: enforce all in order of occurrence (10-2-4);
       –live & dead: enforce live-ball foul (if more than one, then the one chosen by offended team) and all dead-ball fouls in order of occurrence (10-1-4; 10-2-3).
–both teams:
       –live-ball foul by one team followed by a dead-ball foul by other: enforce the live-ball foul (or if more than one, then the one live-ball foul accepted by the offended team), plus all dead-ball fouls (10-1-3; 10-2-3)
       –multiple: When both teams commit multiple fouls, either (a) both teams commit multiple dead-ball fouls, or (b) one team commits multiple dead-ball fouls while the other commits multiple live-ball fouls. Otherwise, there’s a double foul involved, and the analysis drops down to the last two points.
–live-ball: enforce one chosen by offended team (10-2-3);
–dead-ball: enforce all in order of occurrence (10-2-4).
–double:
       –replay the down unless the last team in possession maintains possession by declining their opponent’s foul and accepting the penalty for their own (10-2-1, 2).
       –multiple AND double:
       –once a double foul is involved, enforce the above rule for double fouls, then enforce for multiple fouls.
One final note: keep in mind that a team may decline the distance for a penalty without declining the penalty (10-1-1). An example of this is where the enforcement of the distance would make it more difficult for a kicker, i.e., a try snap from the 1½ yard line rather than from the 3.

It can get tricky determining whether fouls are multiple or double, and what rule takes precedence under the circumstances. Let’s take a look at the details.
Multiple fouls. Multiple fouls are more than one foul by one team. Only one of multiple live-ball fouls is enforced, and the offended team chooses which is to be enforced (10-2-3). If the multiple fouls are all dead-ball fouls, they all get enforced in the order of occurrence (10-2-4). Where one team has one or more live-ball fouls and one or more dead-ball fouls, we can then determine from these two rules that the result is that one of the live-ball fouls, plus all the of the dead-ball fouls get enforced against the guilty team. Keep in mind that dead-ball fouls are always enforced separately from live-ball fouls in the order of their occurrence, and that dead-ball fouls (or fouls during a try) are never combined with live-ball fouls to have multiple or double fouls (10-2-4, 5).

Double fouls. Double fouls are one or more live-ball fouls by each team, other than unsportsmanlike or non-player fouls (10-2-1). The result of a double foul is always to replay the down unless there’s a change of possession and the final team in possession fouled after the change of possession (that is; they got the ball with clean hands; dirty hands mean a foul before gaining possession, and thus, a replay of the down). In that case, the final team in possession may either accept the opponent's foul and replay the down, or keep the ball by declining the opponent's foul and accepting enforcement on the team’s own foul. The final team in possession need not decline unsportsmanlike fouls, and the team not possessing the ball has no penalty options (10-2-2).

Once you’ve reached the enforcement stage, then it’s a matter of determining the spot (basic spot, plus any effect of the all-but-one rule), and walking off the yardage (in the right direction!) (10-3; 10-4).
Try these practice examples:
Play: Team A commits two live-ball and two dead-ball fouls.
Ruling: Enforce one live-ball foul accepted by Team B, and all the dead-ball fouls.

Play: A Team A player holds, a Team B player commits pass interference, then intercepts, both teams pile on the downed Team B player, and Team A’s coach curses loudly.
Ruling: These are double live-ball fouls and multiple dead-ball fouls (personal fouls that cancel each other out unless the half-the-distance to the goal line is a factor, and one unsportsmanlike foul). This results in replay of the down, after enforcement of the unsportsmanlike foul and all dead-ball fouls from the previous spot.

Play: A Team A player holds; a Team B player intercepts, after which another Team B player then commits a holding foul, after which a Team A player commits an unsportsmanlike foul.
Ruling: Team B may ask for a replay of the down with penalties enforced, or keep the ball by declining Team A’s holding, and having Team Bs’ own holding foul enforced from the all-but-one spot of that foul; the unsportsmanlike is then enforced against Team A.

Play: Both teams commit multiple live-ball fouls, and one of Team B’s fouls occurs before B gains possession, after which there are dead-ball fouls by both sides.
Ruling: Automatic replay, unless Team B wants to keep the ball, in which case they will decline all of A’s fouls, and Team A gets to choose which to enforce against B. Any remaining dead-ball fouls are then enforced.