[Galaxy S 4 Q&A, Help & Troubleshooting] im4eversmart:
I noticed many average users out there, bricked their devices so here's a guide for you to unbrick it:

Bootloop is a state when your phone is not able to boot properly and it is stuck on the Bootanimation It is the commonest thing that Android users face with their phone or tablet device and this can be fixed easily by performing certain steps by booting the device into stock or custom recovery mode. Here is our detailed guide that will help you fix bootloop on your device.

1-How to Recover When your Android Device is Caught in a Bootloop:

The reasons for getting a bootloop on your Android device might be anything.Here are some major reasons why your Android device is caught in a bootloop.

-After installing an official or custom ROM

-Flashing a wrong ROM or Kernel

-Running an incompatible app or game

-Wrong Permissions fix for an app or file

Installing a custom mod or theme

Most often we face a bootloop just after flashing a stock or custom ROM over an old one. This might be a major factor behind the bootloop issue on your device. Suppose you have flashed a new version of firmware over the old version. Your old data still remains on the device and the new firmware will use the Dalvik Cache from the old ROM that might not be compatible with the new system files and it will result in a bootloop. It mostly happen just when your device tries to reboot after you have flashed a stock or custom ROM. If this is the case, here is the solution.

Method I-If your device is on stock firmware, that also means it does not have a custom recovery like CWM or TWRP not installed on it, do the following steps:

Pull out the the battery of your phone, wait for about 30 seconds and reinsert it to its place.

Boot your device into ASR (Android System Recovery) mode. The method involves a hardware key combination and varies from one phone to another. For Samsung phones, for example, the key combination is Volume Up+ Home + Power keys. The tablets which generally have no Home button, you can enter the Recovery mode by pressing and holding the Volume Up + Power keys simultaneously.

In the Android System Recovery, scroll down to “wipe cache partition”. option using the volume rockers and select it using the power key.

When you have wiped the data/factory, go back to the main menu and reboot the device by “reboot system now” option.

If the device is still stuck on Bootanimation pull out the battery again and repeat the above steps. This time also “wipe data/factory reset” and then reboot device

The bootloop problem should be fixed now.

Method II-If you have a rooted device with CWM Recovery installed and your phone is caught into a bootloop after flashing a custom ROM or mod, do as follows:

Pull out the battery, reinsert it after 30 seconds and boot the device into CWM Recovery: Volume Up+ Home + Power keys simultaneously.

Go to “Advanced”

Choose “Wipe dalvik-cache”

Now go to “Mounts & Storage”

Choose “Wipe /cache”

Reboot your phone

The bootloop should be gone now. If it still persists, do this.

Boot the phone again into CWM Recovery

Now go to “Mounts & Storage”

Choose “Wipe /data”

Choose “Wipe /cache”

Then reboot your phone.

Now the phone should reboot normally. Next time when you install a ROM, follow the instructions prescribed by the developer. Be more attentive to the warnings before experimenting with any third party ROM or mod. Always ensure what you are about to install is meant for your device.

Note:

If wiping the data/factory reset, and cache partition does not help you, or you are not able to boot into the Android System or ClockworkMod recovery on your device, you can try installing the official firmware on your device.

In case the two methods described above do not bring your device to normal state, the problem is a little serious but still not out of control. The following method is same as installing the official firmware described above, but it also involves flashing a PIT file along-with the firmware. This file is used to re-partition the corrupt partition on Galaxy devices.

source: DroidView.

Hope this small info help.