Downloading the package
The first thing you have to do is go to the Arduino site's download section at http://Arduino.cc/en/Main/Software and choose the right package for your operating system and the software branch that best suits your board.
At the time of writing this, there are two different branches. I'll recommend that you use the Arduino 1.0.X stable branch unless you are going to work with Arduino Yún or Due; in that case, you'll have to choose the 1.5.X branch that, at the time of writing this, is a beta version and, therefore, could be a little unstable or could lead to some errors. However, I have to say that I have been working for more than a year with the 1.5.X branch to program both Arduino Uno and Arduino Yún, and I haven't seen any bugs.
On the Arduino site, you will find precompiled packages for Mac OS X, Windows, and Linux and even a source code package.
Let's take a closer look at each of the supported operating systems.
Windows
For Windows...