Sometimes, you read something that seems a little too similar to what you're writing. You read something that seems to copy what you were putting together.
You read something that completely depresses you because you were sure that this was your original creation.
Deep breath. Moment of calm.
Okay. So your idea is out there. But that doesn't mean your story is out there.
There's a chance that you have more to say. You might have a different perspective. You might have a different message. You might have something different to say.
You might find something similar to what you're writing, but that doesn't mean you have to give up on your piece. Just make sure that your piece has your own flavour to it.