What to do if your research idea has already been published?
It is hard to give advice specific to your case without knowing more, so I'll mostly restrict to general comments here. What you do depends on the field, to some extent, and to the individual paper and kind of research.
But, if you use a known technique to reach a known result, your results are probably not going to be published. It is, at best, a learning experience.
Independent researchers have a number of problems, but they often come down to lack of professional advice in getting started in research. Working with a guide can help you avoid dead ends. The big problem is that there is a lot to know about any given narrow subject and it can take a long time to absorb it. A guide can help you find an appropriate path to learning what is already known and what is still valuable to pursue. Ideally, you'd like to know about the earlier work before you spend time that might not be productive.
You don't suggest that your research is in mathematics, but there, it is possible to publish new proofs of known theorems under certain circumstances. A proof give insight into why something is true as well as the fact that it is. Sometimes those insights can be transferred to other problems yet unsolved. So, a new proof, using a novel technique, can be valuable in itself and might get published.
Another kind of research depends on statistical methods. Social science and some of the &quot;hard&quot; sciences can use such methods. Some of the published results here are worth replicating, since statistics alone only give evidence, not proof, that something might be true. But, again, you need some variation for the new study to be valuable. Sometimes a paper will contain assumptions that may be unwarranted (normal distribution of a variable in a population, say) and a new study making fewer assumptions might be worth doing. Likewise, some medical studies are extremely important and may affect people's health. So, a lot of evidence for what is really going on is needed and replicated studies can be essential. And some studies actually refute the results of others, thus requiring more study. Statistical studies, if done well, have a measurable probability of producing misleading results. Replication reduces the probability of error, provided that things are done properly, and probably with some variation on the original.