Ariz Waqar Wa-Alaikum-Salam Ariz Waqar,
I agree to Khan_arman advice. Try to follow that, In addition to that I woul like to suggest few things:
1- You have realized that you were in a bad habit and now intend to change it. Excellent!! Feel good about yourself that you are trying to follow positive and healthy attitude.
2- Keep a check on yourself. Take paper n pencil. List down total number of hours you stay wake. Make a column and list down your each activity. Next thing highlight negative activities or fruitless activities.
3- Replace those negative things with positive ones.Like gardening, reading a book (not from net but get good book), walking etc.
4- Spend time with family. parents n siblings. Don't get yourself cornered in the name of computer and work. social rahen. ghar walon ko time dain. jokes share karen. healthy guftugo karen. apnai relations alive rakhain.
5- Keep a check on your friend circle. Change bad company if you have.
6- Excercise is a MUST! Go out AND walk, do running, watch blue sky enjoy nature. relax your brain.
7- Last but not least. OFFER your regular Prayers man. and keep yourself busy in some zikar. like Astaghfar, Allahu Akbar, Subhan Allah etc. Allah ko apna zikr bohat pasand hai. is se aap ki duniya aur aakhrat dono sanwar jaen ge InshAllah.