Melatonin is a hormone released by your pineal gland that begins the process of sleep. It begins to shut down your catabolic processes and initiates anabolic processes. Can't think of any serious side effects off the top of my head except for dependence. The pineal gland releases melatonin in response to a reduction in light received by the retina. If you start taking pills this can throw your circadian rhythm off. It can also down regulate the release of endogenous melatonin from your pineal gland meaning that it will be harder to fall asleep without it.