Potato rot is caused by a bacterium in the soil. The best way to prevent it is to avoid overwatering.