There are certain measures you can take to prevent moss growth in the future. You should break up compacted soil to improve soil drainage. This will strengthen the roots of grass and other plants, which, in turn, will prevent the growth of moss.
You can also reseed your lawn with grass seeds and supply sufficient nutrients to promote grass growth. This will fill out any blank spots and leave no room for the further growth of moss.