I found out that my PhD topic has been done before, what can I do , to make it an original topic without changing the main idea I am a PhD student , and I am in my first year, started four months ago
Ask your advisor. Your advisor:


Is likely to be the person most familiar with the direction your thesis is supposed to take, and therefore able to advise on how to modify it
Is likely to be much more experienced than you and therefore better-positioned to decide what to do next
Is likely to care enough to provide you with that advice
You can't do anything without your supervisor's approval anyway


It's possible you'll end up changing topics (since it's only been four months anyway), you might find that the previous work isn't exactly the same as yours, etc. But this is all speculation. Ask your advisor and figure it out from there.