Booking.com Interview Question

What happens if I call a method on a garbage'd object. How to prevent it.