The sim is a Sprint sim? I am assuming that is what you are saying. But you don't mention who the carrier you have now is?
An unlock code is for a phone, not a sim, so I am wondering which you are referring to? If you are trying to use a sim from Sprint, on a phone with another carrier, that won't work. The sims are carrier specific.
However, if you are trying to use the phone with a new carrier, using the new carriers sim, then it should work.
Your old carrier (assuming that is sprint) gives you a code to unlock the phone (which you say the did give you) and then the phone would work with the new carrier.
But, there is a catch there, you have to have a phone that works with the new carriers service. Not all phones will work with all carriers.
Did you check with the new carrier to see if the phone will work with their service?