please help me understand this math problem

You have two sets of terms that look similar:

3ab and 3a

4b^{2} and 4b

Let's group them together, then pull out a common factor:

(3ab + 3a) - (4b^{2} + 4b)

3a (b + 1) - 4b(b + 1)

We now have a common factor of (b + 1), so if we pull that out, we have

(b+1)(3a - 4b)