Mold Earth works...
If the dirt or stone you target is on the ground, you cause it to become difficult terrain. Alternatively, you can cause the ground to become normal terrain if it is already difficult terrain. This change lasts for 1 hour.
The difficult terrain description includes deep swamps, so Mold Earth could turn a small section bog into habitable ground.
...on a small patch of ground...
Unfortunately, you'd need each member of a household able to cast this cantrip, as...
If you cast this spell multiple times, you can have no more than two of its non-instantaneous effects active at a time
...for an hour
In the long term, your inhabitants will need a solution that doesn't involve near-constant re-upping of cantrip durations. While certain spells such as Private Sanctum gain a permanent duration with repeated casting, Mold Earth isn't one of them.
Though not directly addressed in the rules, a few Survival-savvy individuals could (at the DM's discretion) devise longer-term solutions, such as diverting a river that feeds into said bog, or digging down to bedrock and creating a foundation to prevent seepage into a patch of ground. Ultimately, this looks like a job for craftsmen or a mid-level caster judiciously using Wall of Stone