Your brain looks for associations, like how a gym is a place to workout, a bed should be a furniture to sleep on. I have made the bad habit of using my phone and even eating on my bed. Once I stopped and only lay down on my bed to sleep my subconscious mind recognized the pattern and I am falling asleep faster then I was before.