The secret behind removing molds forever depends on the mold cleaners you use, however, the best way to prevent them from recurring is simply to be prepared for them at all times. Molds have no preference on the homes they invade. It takes a few mistakes and before you know it, they are your next big problem.
It has been rumored that bleach kills mold in a second, but what about the carpet, will it not be affected? Note that bleach doesn’t necessarily guarantee you that the mold wouldn’t come back and for this reason, preparation is the key to that issue. Just have the leading mold preventives around, and attack them as they show up.