Accept distraction with every fiber of your body.
Meditation usually creates this “don’t think of a pink elephant” problem for beginners or even for the more advanced practitioners that went down the wrong path. That’s because even though everyone tells them that it’s okay to get distracted, it still doesn’t feel okay for most, because they think of the goal too much. A goal is in the future. Meditation is in the “now”.
It’s not even that it’s just okay to get distracted, it is actually preferred.
Every distraction that gets noticed (!) makes it more of an “object.” It’s like training a muscle. The state of thinking without noticing, which is what we tend to do all day, is the only state of distraction that won’t teach you anything.
While meditating, try to unlearn what you created, here, by now purposely thinking either in words or images. Whatever it is that distracts you most. Learn to not mind thinking while meditating, this way.
After a while, try to focus again on what you’re used to focusing on, and wait for the learning opportunity and accept it. If you do feel frustration again, focus on, and also locate the sensations of that emotion for a while, and not on the thought had caused it. Make an object of those sensations. Compare those inner sensations with other non-emotional sensations, like hitting your head, for instance, and realize it’s not so bad, really. Now gently go back to focusing again, and wait for the next learning opportunity.
The only path to thinking of a pink elephant less often is to completely accept thinking about it. We can’t ever actively not think of something; it just happens automatically once we learn to deeply accept it.
With meditation, the learning is in the falling, not in the walking.