The Samsung Galaxy Y has options for you to Reset to factory data your phone through the Settings page which is useful if your phone is still working when you want it restored for reasons like you are transferring ownership of the phone to other person or you just like to wipe out your data and start anew.
Be sure to always make a backup of your important files so that when times like this that you are forced to do a factory reset, you can always go back and restore your important files.
When your phone becomes unresponsive due to a crash, you cannot do it through the Settings page so your only option is to do a hard reset using the hardware buttons of the Samsung Galaxy Y. To do it, remove the battery first and then put it back again after about two seconds. Do not power up yet. Just press the Volume up, Home button and Power button simultaneously at the same time and wait for the menu that will appear with options. Use the volume button to toggle the selection and select “Wipe/Factory Data Reset”. After the phone is rebooted, you have a spanking new interface to fiddle with.
Another easier way to reset you Galaxy Y is to dial this code *2767*3855#. Your phone will revert to default factory settings upon reboot,