I accidentally bought a spice I didn't need
That's unfortunate. Which spice did you buy?
A yellow spice, I can't remember it's name. I think it was cumin
It can happen sometimes to buy things by mistake, so it is okay to go back to the store and return it. Then you can buy the right spice that you need.
I can't return it since I've already used it.
It's too bad that you can't return it, but this gives you the opportunity to experiment with your cooking. Maybe you should look for a recipe that uses cumin, so you can see if you like it.