Complete prevention isn't possible.. but u can always slow down the process of rotting.
Few tips to achieve that:
1.Do not store fruits or vegetables in airtight bags. This prevents them from releasing gases and breathing. When fruits and vegetables are suffocated, they will spoil faster.
2.Always store produce whole, even with stems attached. When fruit and vegetables are broken apart, the decay process will speed up.
3.Most fruits and vegetables should be refrigerated, with a few exceptions. This slows the release of gases and allows the produce to last longer.
4.Never refrigerate potatoes, onions, winter squash, or garlic. These should be stored seperate from each other in a cool, dark, and dry place.
5.Be careful what fruits and vegetables you store together. Some produce releases ethylene gas. This gas speeds up the decay process of ethylene sensitive vegetables and fruit. Gas releasers that should be refrigerated separately include apples, apricots, cantaloupe, figs, and honeydew. Gas releasers that should not be refrigerated but should be stored separately include avocados, unripe bananas, nectarines, peaches, pears, plums and tomatoes.