With Shimano hubs you can replace the internal assembly, saving you from a full wheel rebuild. Here's an example. Replacing individual internal parts may be possible for some hubs, but it's not worth the time and hassle IMO.
While your hub is still working you can extend its life with routine maintenance:
- Keep the cable adjusted. Some hubs have a built-in indicator to help.
- Replace the internal oil/grease occasionally. The exact procedure depends on your hub model. Here's a Shimano guide for replacing oil.