Most of the defunct satellites just keep orbiting indefinitely until the very slight air resistance at their altitude slows them enough to de-orbit, at which point the smaller ones burn up in the atmosphere and the bigger ones mostly burn up, but pieces sometimes reach the ground or the ocean.

Some satellites are above low Earth orbit and will remain in orbit for billions of years, whether they’re working or not. These include your weather satellites and those owned by DirectTV, Dish Network and some others out in geosynchronous orbits.

Some satellites have small fuel reserves to keep them in orbit when they need a boost, but can also be used to do a controlled de-orbit.