Have a clear goal for yourself, an ultimate goal so to say, and several mini goals as steps towards it. For example if the goal is leading a spiritual life, then several steps could be reading books related to this or even hearing on the YouTube about it. Even if a clear goal is not there, cultivate an urge for progress, to learn new things, to know. Fix a time for everything and try to stick to it. Ultimately of course it is about strengthening your will and remaining busy to avoid boredom and too much of free time.
Affectionately,
Alok Da