How do you fight desires when you're alone?
There is no guaranteed way to control desires if the desire is strong and one has the privacy to engage in it without suffering material consequences. A person who wants to lose weight will almost certainly not be successful if they have a freezer full of ice cream. Regardless of their will power, when the desire is strong enough and the desired thing is easy enough to get, people succumb sooner or later.
What one should do is rearrange their life so that engaging in that desired thing becomes more difficult. A person who seriously desires something can come up with all kinds of creative ways to get over obstacles to get what they desire. You have to do the same thing but in the opposite direction, coming up with creative ways of making it more difficult to get the desired thing.
For more on planning against desires see the following answer, it suggestions can be generalized to any kind of desire: Dealing with an addiction to pornography