I used to have that problem with sleeping and hunger. For me it just went away eventually.
Someone here or on reddit once had a problem with their mind keeping them up for either hunger or to check their phone or something, and they started doing pushups every time it happened, and some part of the brain learned the association and cut it out. I never did that but it might be worth trying.