I put a gem that I thought was a diamond in to my armor, and it was actually a topaz. Is there any way to get them out?
To empty a socket in Diablo 2 LoD, there is the Horadric cube recipe:
1 Hel Rune + Scroll of Town Portal + Any Socketed Item = Remove items from sockets Warning: This will destroy any gems, runes, or jewels you have socketed. This is useful if you are not happy with the gems you have socketed and you want to socket the item in another way.
If you want to remove your diamond from the socket (and thus destroy it) and replace it with a topaz, you can do it but the cost (Hel rune) is probably not worth it unless the armor is particularly valuable and you intend to use it for a while.
This recipe isn't present in Diablo 2 Classic, which doesn't have runes or socketed armor, so presumably you are talking about D2 LoD and not Classic (aka non-expansion.)
Diablo 2 offered no way to recycle a weapon or piece of armor. There is no way to remove a socket without the use of an unofficial mod or save editor.
If you are playing with a local character, I would consider simply using a character editor. It has been a long time since I played, but I remember there being a few good programs with a lot of customisation. You might have to re-generate the gemstones and the armor.
This feature was only brought in with Diablo 3, where if you salvaged an item with something in it's socket, the socket item will be returned to the player at the expense of destroying the main item.