The safest way to run the rule is mechanical. Step 1: read the expression from the outside and name each layer. Step 2: differentiate the outermost layer and leave everything inside it completely alone. Step 3: multiply by the derivative of what was inside. If the expression is nested three deep, the answer carries three factors, and the count of factors is itself a check on your work.
A warning about notation that BC exams exploit: $\sin^{2}(3x)$ means $\big[\sin(3x)\big]^{2}$, so it is nested three deep — squaring, then sine, then $3x$ — and its derivative is $6\sin(3x)\cos(3x)$.
Why it is multiplication and not addition. A small segment $dx$ on the $x$-axis passing through $g$ is stretched to $g'(x)\,dx$ on the $u$-axis; that segment then passes through $f$ and is stretched by a further factor of $f'(u)$. When two magnifications happen in series, the total factor is the product, just like two lenses placed one behind the other. The picture also explains why forgetting the inner factor is not a small error: if $g'=3$ and you drop it, the result is three times too small, not off by a few percent.
Worked example: three nested layers with a logarithm
Find $\dfrac{dy}{dx}$ for $y=\ln\left(\cos\left(3x\right)\right)$, then simplify to a familiar trigonometric function.
Solution
Three layers: the outermost is $\ln$, the middle is $\cos$, and the innermost is $3x$. So the answer must have exactly three factors.
The three-second check: you count three layers in the problem, and the first line of the solution has exactly three factors. If you wrote only two factors, you surely forgot a layer.
Common mistake
The costliest mistake of the chapter is forgetting the factor from the innermost layer: writing $\frac{d}{dx}\sin(4x)=\cos(4x)$ instead of $4\cos(4x)$. The prevention is not "be more careful" but a counting step: before writing the answer, count the layers in the problem and count the factors in the answer; the two numbers must be equal. The second mistake is stuffing the factor inside the function: $\frac{d}{dx}\tan\left(x^{2}\right)$ is $2x\sec^{2}\left(x^{2}\right)$, not $\sec^{2}(2x)$ — the chain-rule factor always stands outside and never slips into the argument.
Key takeaway
Count the layers, one factor per layer, and the factor always sits outside the function. The notation $\sin^{2}(3x)$ is three layers, not two — read the notation carefully before putting pen to paper.