As others have said XDA is the key however if you dont want to send it back then you will have to do the following
Ensure you have installed samsung kies so the usb driver is installed but close the software down before doing these
Download ODIN software
Download the stock image for your phone from SamMobile (select model and then correct region)
Extract the file (you may have 4 or 5 files or one large file)
Put phone in download mode by powerring off, then hold down volume key and power key plus home key at the same time and follow instructions plug in usb
Open Odin and select the correct file (look up guides as it varies from model however single file is normally put in pda /ap section)
Then flash the software
At this point do not unplug the cable or ya stuffed. Once flashed it should reboot ok.
Depending on the file you selected it may or may not wipe data on the phone
Links
Sammobile On5 SMg550FY Model (india)
https://www.sammobile.com/firmwares/galaxy-on5/SM-G550FY/
Sammobile On5 SMG550 (china)
https://www.sammobile.com/firmwares/galaxy-on5/SM-G5500/
XDA Forum for ON5
https://forum.xda-developers.com/samsung-galaxy-on5
Odin File can be found at the bottom of this first post
https://forum.xda-developers.com/sa...ock-rom-samsung-galaxy-on5-on5-prosm-t3450732