Have a leetcode desk, shed, garage or whatever. Some place you go every day for some number of hours. Without a phone or a book.
You don't have to do the leetcode there. Can sit there for the whole time staring at the wall if you like.
But if you're doing anything there, it's leetcode. Your brain is a pattern matcher. It doesn't like boredom. Thus you can train it, a bit like a dog.