Sleep aids can be a helpful way to regulate one's sleep cycle. However, as you must be aware given you asked the question, there are many side effects that can cause problems. This is a complex issue and one where one recommendation does not fit all people. I would strongly recommend you discuss this with your doctor
First, a sleep aid is a common term that refers to an entire group of medicines that help one sleep. They all work differently -- which makes the topic somewhat complicated. Some work by trying to alter the sleep cycle with melatonin, some work as anti-histamines (like anti-allergy meds) and some work by activating benzodiazepine receptors (like anti-anxiety meds). They all have different side effects.
Two of the biggest considerations include (1) addiction
. This occurs after multiple uses but is a really common problem. Your body becomes used to it and then requires it to sleep. This rarely happens after one use. (2) "Intoxication" - taking a sleep pill can make you tired for an extended period of time, maybe even longer than your flight. This can make you disoriented and can be dangerous. They can also alter your dreams. Taking a med for the first time while flying may not be the wises idea.
Again, please discuss with your primary doctor.