In general healthy, growing plants are quite able to resist infections with these. However they commonly occur as a secondary effect of other problems such as attack by insects pests, physical damage leaving exposed plant tissue or incorrect growing conditions. The single biggest cause is probably fungal rots entering via dead roots caused by poor root aeration.
The best way of avoiding these problems is to provide conditions which prevent their development, i.e., a healthy pest free environment. If they occur and are spotted early it may be possible to save the plant by cutting away all the diseased tissue with a clean knife.
In particular look for discoloured vascular tissue which may be red or brown and penetrate some way into otherwise healthy tissue. The knife should be cleaned with alcohol to prevent spreading fungal spores. It may be beneficial to dust the cut surfaces with flowers of sulphur.
Fungicidal chemicals can be used to give some protection but this should only be tried as a last result since they are not effective against the whole range of different rot producing fungi. Young cactus and succulent seedlings are particularly prone to 'damping off' which is a fungal attack. This can be partially controlled by copper fungicides. The other frequently mentioned chemical for this purpose, "chinosol", is suspected of causing some damage to the seedlings and is not recommended.
Unless you are a chemist and have the necessary knowledge it is inadvisable to use strong mineral acids for this purpose. It is possible to use citric acid or acetic acid (vinegar) but the favourite remedy is potassium dihydrogen phosphate which also supplies useful elements. If your local rainwater is sufficiently clean then this is the best way to avoid this problem.
It is more likely that deficiency diseases will shown up in peat based rather than soil based composts. If a plants looks chlorotic or refuses to grow properly it is worth trying fresh compost to see if this solves the problem. If locally available soils are know to have particular deficiency problems it may be worth adding appropriate supplements.