How can a goiter be prevented?

Usually it can't. Iodine deficiency goiter is really the only preventable cause of thyroid enlargement. This is extremely uncommon in western societies. If you are developing a goiter, some doctors may suggest thyroid hormone supplementation to "suppress" the goiter, but this generally isn't terribly effective.
Keep appoinments. It is important to keep all scheduled appoinments and learn of the signs. If they start occurring then don't wait to be seen.