Certified GKH Gardening Expert
You may need to replace it with fresh, new potting soil. If you have a plant that needs continuous moisture, you may not be able to avoid the mold. Sunlight helps.
You also may want to try a gentle, homemade fungicide described in this article: https://www.gardeningknowhow.com/garden-how-to/info/homemade-fungicide.htm
Here are some prevention tips: https://www.gardeningknowhow.com/houseplants/hpgen/preventing-mold-in-the-soil-of-a-houseplant.htm