I'm an idiot when it comes to this kind of thing. I've searched the hell out of this topic to no avail (leading me to believe that I'm being dumb).

My bass tuning key on my G-string was broken so I bought a new one from AllParts. It came, and I unscrewed the nail from the tuning key on the back of my bass (along with the nail inside the peg), however I cannot remove the main part. How does one go about removing the old tuning key (not just the peg, but the entire [in my case gold] thing that is on the back of my bass' neck?

Thanks for any help, and please let me know if any part of that made sense as I don't know a lot of this terminology and feel that I may have done a poor job in explaining myself.
Sorry, can you explain to me what the nut looks like? Is that the big circular thing at the back of the neck? Thanks for your quick reply!
^Like he said.

In this photo, the nut is the cylindrical thing on the right:

"Maybe this world is another planet's hell?" - Aldous Huxley