Now, that’s just the official way of installing updates.
If you've unlocked the bootloader, you'll want to stay away from this method.
First off, you'll need to figure out the specific model number for your Samsung Galaxy S4.
Swipe down from the top of the screen of your phone to get the notification tray, tap the settings gear icon in the top-right. Down at the bottom, tap About device and make note of the model number.
Now do a search for that model number at this site to find the latest available firmware for your device.
You'll need to register for an account there to get downloading, so go ahead and do that.
xda-developers is also a reputable source for device firmware.Once the firmware is downloaded, you'll need some software for PC to load it up onto your phone.Odin is the tool used to load up official Samsung firmware.Download and install the latest version from over here.You may also need to download the Samsung USB drivers to your PC, also available at the same link.With that, you're ready to start by putting your Samsung Galaxy S4 into download mode.