You can’t really make a homemade sleeping pill. You can, however, do a few things to help with your insomnia. Limit your intake of alcohol and caffeine. Keep to a schedule. Try to go to bed and get up at the same time every day. Get plenty of exercise. Another thing that helps many is to use your bedroom for sleeping only. Get the TV out of the bedroom.
There are many safe and natural insomnia remedies that you can try. There is no need to try to make pills. Look for ready made products that contain any of the above, and remember that it may take a few tries to find what works best for you: melatonin, Valerian root, kava kava, tryptophan, chamomile.