How can I prevent milia from occuring?

Can't always prevent. Milia occur when a substance from the skin, known as keratin, gets trapped under the outermost layer of skin, forming a cyst. Milia can also occur when other debris or damage clogs the pores in the skin. Good hygiene will generally prevent these secondary milia, but they can still occur normally, or after injury to the skin. The good news is that milia are harmless, and will eventually go away.