Two real things here.
First, naming. A component's Name should say what it does, so the code reads on its own:
| Instead of |
Try |
Mom |
SaveButton |
Dad |
CancelButton |
Grandma |
SettingsButton |
You rename in the Object Inspector, in the Name property. Lazarus updates the declaration in the form class for you. It does not rename event handlers you already made, so GrandmaClick stays GrandmaClick until you change it yourself.
Second, deleting. Removing a component from the form leaves its event handler in the source if there's code in it. Nothing is lost. It's safe.
Read the error message. Then read it again.