A specious inclination is to assume that competition is a bad thing. To assume that you shouldn’t bother with your idea because someone else has already tried it or is doing it.
The reality is, competition means there is a market. So, competition can be a good thing. Without out it you might be heading into unchartered territory which often leads to a product that nobody wants.
So if you stumble across someone doing something similar and you feel threatened or any other negative emotion, acknowledge how you feel and remind yourself the reasons why it’s actually a good thing. In time you can start to feel good when you see competition. And start to ask yourself, how can I exploit the fact that there is competition.
For example, if you’ve wanted to write a book about X and you see a new best seller along similar lines. Then, now may be the time to write your book.
What unique perspective do you bring to the table? Perhaps an opposing view?
Would the publisher that published the best seller perhaps be interested in your book?
Or how about competing publishers? They may be happy to get some alternatives into the market.