We start with:
=>2c^2d-4c^2d^2
Next, we identify terms that are similar:
=>color(orange)(2)color(blue)(c^2)color(red)(d)-color(orange)(4)color(blue)(c^2)color(red)(d^2)
Let's start with color(orange)"orange". We have 2 and 4 on opposite sides of the minus sign. The greatest common factor of these two values is 2, so that is what we factor out first. This will leave a 2 on the RHS of the minus sign.
=>color(orange)(2)(color(blue)(c^2)color(red)(d)-color(orange)(2)color(blue)(c^2)color(red)(d^2))
Now let's look at color(blue)"blue". We have the same term c^2 on both sides of the minus sign. So we can factor this term out.
=>2color(blue)(c^2)(color(red)(d)-2color(red)(d^2))
Now the last type of term is color(red)"red". We have one term with a power of 1 and one term with a power of 2. With powers, we factor out the lowest power L. Any terms with a power higher (say H) than the lowest will be leftover with a power equal to H-L. Let's factor out d. Note! The term on the LHS of the minus sign will become 1, since there are no other terms left after factoring.
=>2c^2color(red)(d)(1-2color(red)(d))
Now that we have touched all of the terms, we are finished. The factored version of the expression is:
=>2c^2d(1-2d)