Wrong way:
Is your new nut already cut to the right depth for your strings and bass?
If so, and you are desperate, read on. Ok, this is really for survival purposes only, and I will omit the story about carving a nut at a gig out of a plastic comb with a pocket knife, here goes...
I have found that one can pop the old nut out whole with a small sharp blade, but I am no expert. Loosen the strings, pull them aside, put the blade in the between the nut and the FB and pry/pop it out gently. If you do it and it works, save the old one, even if it cracks. You can compare it to the new one and see if the slots look to be the right depth.
Put the new one in, string it, and go! Yes, I have found that a new nut will stay put without glue--but again--I don't advocate it and am no expert, but I have gotten away with this a couple of times.
Right way:
Take it to a good luthier. I have a bone nut on my Jazz which was put on by a tech at Gryphon Stringed Instruments in Palo Alto, CA. The nut is perfect in every way. Not an expensive repair.
