Onions contain a component that stabilizes the nerves and helps sleep well. Therefore, if you don't sleep well, it is good for you to eat a fresh onion at supper.
If onions are washed in water, they will lose mucus and aroma. Therefore, if you are going to eat onions for insomnia treatment, you should not wash onions in water but take only off the husk and eat them.