Rebuilding InDesign Preferences

How to replace corrupt InDesign preference files on Mac and Windows