There are a few things you can do to prevent mold:
Keep your home clean and free of clutter. This will give mold fewer places to hide and make it easier to spot and clean up any mold that does appear.
Fix any leaks in your home promptly. Mold loves damp, dark places, so leaking pipes or roofs provide the perfect environment for it to grow.
Make sure your home has good ventilation.