You can't possibly set an object to null. An object is an object and it is always an object. Variables refer to objects and you can set variables to null. Any object that you create should be disposed when you're done with it if it supports it. Disposing an object releases its unmanaged resources.

Setting a variable to null is something else. Doing so removes that reference to the object from the system. If that was the last reference to that object, i.e. the last variable that referred to that object, then the object is flagged as available for garbage collection. Setting variables to null is usually pointless. If it is a local variable and it loses scope soon after then the reference is removed then anyway. You would only need to set a variable to null if it will not, or may not, lose scope for some time. That would include member variables or local variables in long-running methods.