The simple answer is to replace our earplugs when they begin to fail. Seriously, it’s just not worth the risk. Unless you’ve gone for the custom-fit, high-end expensive models which are the tools of the trade for top musicians, the chances are the earplugs you’ve got didn’t cost the earth. You can consider the cost of replacement as an investment in your long-term ability to hear properly.
What I would advise is to think about the longer-term picture. If you’ve been using cheap foam earplugs, you should know that the materials in them mean they cannot be recycled, and therefore often end up clogging up landfill sites - and should only be used once.
Silicone, on the other hand, may cost a tiny bit more up front, but they last longer, can be used multiple times, are easy to clean and can usually be recycled when they do reach the end of their gig-going life.
Another way to extend the life of your earplugs is to give them a proper clean. Again, silicone has the advantage here because a quick wipe with warm soapy water is all it takes to get the worst of the gunk off them. You can use cotton buds to get into the nooks and crannies of some of the more complex shapes. Be sure to leave them to dry before they go back in their case.