What is the best way to empty a variable if you are storing an object inside of it?

You go like this-

variableNameIWantToEmpty = null;