upgrade firmware

Hello
I'm new to iphone. I just got a 2nd generation iphone. It was working on AT&T. I can use only by unlocking it.
Please tell me how to upgrade the firmware of iphone? Also which firmware is best for 2nd gen. iphone?
Here is a step by step guide by Apple

Go to Apple - iPhone - New features in the iPhone 3.1 Software Update.
And Click Learn How

Original thread: https://forums.imore.com/threads/upgrade-firmware.182611/