Do a search on Google or go to XDA forums and look for the Original files based on your device model and learn how to use Odin, you need to put your phone in Odin/Download mode, Turn it off and press and hold Power, volume down and Home buttons until you see the menu then with Odin and the file ready you should be able to restore it to stock.
The smart switch program has recovery programs to help you out when that happens. And it should find and flash the stock file for you. Anyone correct me if I'm wrong.
as said, download the latest version of ODIN, find the correct TAR file for your device, and get into download mode as erasat said. its really quite easy if you follow the steps correctly. I really have to ask, just how did you accidently root your device?