How can I get my iPhone out of a boot loop?

iphone loading for hours. boot loop?

I have an iphone 4. I purchased and unlock from bell. I was going through the steps and selected to delete all data and restore to factory. however I believe whoever tried to unlock it for me had it jailbroken first. now I think its in a boot loop from what I have read. how do I fix this. loading for hours on end. when I plug it into the computer it wont recognize the device either
Re: iphone loading for hours. boot loop?

1. Put the device in DFU mode.
2. Connect it to iTunes.
3. When iTunes detects that the device is in recovery, select to restore it.

Original thread: https://forums.imore.com/threads/how-can-i-get-my-iphone-out-of-a-boot-loop.304930/