Phone freezes cannot do a factory reset
May I assume you have already tried a "hard reset"? (There are several easy-to-follow instructions posted on YouTube - just search for "Galaxy Y hard reset"). If so, see below. If not, know that the key part is to remove the battery before proceeding. If you're really lucky, the phone will boot up normally and everuthing will be fine; if not, the hard reset procedire, if it works, will boot up a factory reset device, which will PERMANENTLY wipe all apps and data from your phone. But at least the phone may work. If, however, the phone won't even begin to boot after removing and replacing the battery, your phone is - sadly - most likely "bricked." It may be revivable using professional tools, or at least the data may be recoverable, but it is probably not worth the considerable expense! Instead, it would surely be time to move on to a more modern device, such as the S4 or S5. Hopefully, your data is properly backed up, so it can all be loaded onto your new device. If not, you may be SOL...