making an object out of part of a mesh

I have a lamp that I made with a lightbulb that I want to make a seperate object.
How do I do this?

Select the vertices you want to separate in edit mode and press P

Thank you!!!