For most of the things that go into space, we don’t repair them!
There have been a lot of missions that have flown a really long way (Rosetta went behind Jupiter, Voyager has left the solar system, lots of missions have been to Mars) and they have to work whatever happens. Telecommunications satellites (where your TV signal comes from) can last up to 25 years!
On the International Space Station, because there are humans, they can do some repairs. It takes a lot of planning, to make sure the astronauts will be safe. They have spacesuits, which contain air to breathe (a bit like divers) and it’s well sealed up, so the air cannot escape. They’re always tied to the spacecraft, so they can’t just drift off. The repairs are really hard to do, because a lot of the things are fiddly, but they’re wearing gloves. You could get an idea yourself by putting on some motorbike or gardening gloves and then trying to pick up individual bolts and screws or other small things.