Worn footrest rubbers can transmit vibrations to your feet and can allow your boots to slip off the foot peg. If you're lucky the rubbers may be screw attached but on older motorcycles they're normally an interference fit. Remove the rubber either by twisting or cutting if it's firmly attached.
Clean the metal where the rubber was attached then fit the new rubber but never use grease or soap as it'll allow the rubber to move when you need it to stay in place. Instead squirt some carburetor cleaner down the mounting hole and drive the rubber in place. The solvent momentarily lubricates then gets evicted as the rubber grips the metal bar. The improvement to your motorcycle's ergonomics is amazing.