You can learn to control your mind

You can learn to control your mind.
Sometimes I have hard time to fall asleep. Especially when I have little physical activity during a day or much mental activity during a day. Last time I couldn't sleep well and I started to be nervous and anxious about that for few seconds, but then I managed somehow my nervousness. I controlled it and it was gone, I totally accepted "my that moment state", which was unability to sleep or to fall asleep.
Next day, I thought about this alot. The conclusion is:
You can control you mind. If you don't control it, it will control you. Anybody can learn this.