Clearing existing codes is optional but can be done to remove old or unauthorized access by pressing the 'Learn' button until the indicator light blinks or goes out.