I'm taking a codene cough syrup can I take a 10 milligram melatonin with it?

Be careful. Both Codeine and melatonin have sedative effects, and the two together may cause significant sedation. If you are taking other meds, there may be further interactions. If you have respiratory problems, the combo may exacerbate those problems. You may also feel groggy in the morning; so be careful with machinery or driving. I'd advise using one or the other, not both.