The bacteria that is responsible for bacterial infections will always be present in every tank. You cannot stop it. The reason bacterial infections happen is because they were able to penetrate the tiny blood vessels when the skin and slime coat are ruptured thus resulting in secondary infections.
When a med stains the silicon sealant, you cannot clean that off no matter which method you use in your vain attempts to remove it. This occurs with acriflavine, methylene blue, malachite green, bronopol, etc.
There is no point replacing the sand. Besides doing so will cause your nitrogen cycle to crash and you have to repeat it again especially if you wish to clean your filters. The choice of replacing it is up to you. Could you please tell us the history of your bacterial infection issue? For columnaris, septicemia, finrot and other related bacterial infections that are not virulent, these unfortunately will occur especially when your fish has a very weak immune system and exposed as a result of injuries. There's no point disinfecting by a large degree since they cannot be prevented entirely except if you are able to keep stressors away that are responsible for the infections.
If you are quite worried, you may disinfect your tank with potassium permanganate or 10% bleach solution. The sand can be placed under direct sunlight to sterilize it along with the filter media. The filter containers may be cleaned with bleach solution. Do remember this is similar to starting a new tank unless you have other established tanks to grab established filter media from in order to quickly cycle the tank. The decision is yours.