Write down that thought!
But first: Reframe it.
Do you ever find yourself thinking, "Why can't I have that kind of ____?"
(____ = Job/success/freedom . . . fill in the blank with whatever you're currently envying about someone else's life!)
When you have an "I wish" moment, ask: "What would it feel like if I did have it?"
How would you feel differently if you DID have their [job]?
What is it about their [success] that you're attracted to?
Identify the emotions, the lifestyle, the opportunities — whatever benefits you believe you would derive from getting what you want.
Those are the specifics you write down, the way I described here. This is the end of fantasizing and the beginning of actually having what you want.