It works sometimes and then it crashes again and it doesnt work.
So it's not that it doesn't work it's that it crashes? Was it brand new or used?
Try doing a factory reset, turn it off, and press and hold power, Volume up and Home buttons until you see the Android robot and the message that it's updating and then release the buttons, if you don't want to lose all your data and settings you may try the Wipe Cache Partition in that menu first to see if it works if not go back and do the Wipe Data/Factory reset.
Obviously before you do the Factory Reset, do a Full backup using Samsung Smart Switch (Look for the threads here or look for the apps on Google) so at least you can restore some of your actual settings and apps.
If none of the above fixes your issues I'd definitely contact the seller and let him know about the issue today, even if it was purchased on eBay the seller should have some warranty or returned period, if not, contact eBay and ask for a refund., then get one locally or if you still want the Unlocked, look for another seller, don't get discouraged by faulty devices, it can happens to all of us. With millions of does sold, there will be always some defective ones.