Where the pivot is for the peg. Remove the cotter pin from the bottom side. Slide the shaft out being carful not to lose the spring. Then the whole peg will come off
You can stick a plug in it to take it to the shop for replacement. Ive done it and it was farther than 10 miles.
Like everyone else has said replacing both is the best plan and a great upgrade from the stock bricks that are called tires