I had two children, before that I was a terrible sleeper, would take me an hour+ to fall asleep. Now I can close my eyes and go to sleep with no issue. I think it was a kind of training when my kids were young and would wake up multiple times per night, when you got back to bed you made sure you went to to sleep ASAP as you could be up again shortly. There is an alleged military technique that works but I think the practice part is a big factor, https://www.newshub.co.nz/home/lifestyle/2018/09/the-secret-..., bad sleep habits are hard to break and good ones hard to build.