There are a lot of different techniques for getting to sleep.
Two of them are purely physiological. One is to lie on your back with pressure on the back of your neck just below your head. That's a trigger to sleep.
Another is to lower your "core body temperature" - many people find that cooling down helps them get to sleep. A warm (but not hot) bath actually cools you down as you step out into the colder air, dry off and the residual water on your skin evaporates.
Psychological methods usually involve either trying to reduce stimuli on the brain or setting it a task that's too difficult so it effectively "gives up".
An example of the former is to imagine your consciousness as a big, black empty box and you have to prevent anything from entering the box. That works for some people.
An example of the latter is to try and divide (say) 16,908 by 30. Aside from anything else, the "8" at the end frustrates the hell out of your brain and it usually retreats into unconsciousness.