Hello Friend, Good that you are seeking a help here. You need to bring a discipline in your sleep routine. You may be having some emotional disturbance that is causing sleeplessness. Fb, WhatsApp are bound to distract your mind and aggrevate the sleeplessness.
Take a professional counselling support to understand yourself to find the reason or root Cause for such behavior. I am sure will see a different prepective of your problem and suitable solution to overcome this issue.
Next Steps
Consult a psychologists directly or online. Feel free to reach out to me online through Practo app for further detailed evaluation and recommendation.