Before learning to use the piano pedals, it is important to understand how they work. Modern upright and grand pianos have either two or three pedals.
Where there are three, these are, from left to right: the soft pedal (also called 'una corda'), sostenuto pedal and sustain pedal:
Where there are two pedals the left is the soft pedal, the right the sustain:
The sustain pedal
When a note is played on the piano it activates a hammer that strikes a string inside the instrument. This produces a sound. When the finger is removed from the key a damper stops the sound:
If, however, we press the right hand pedal all of the dampers are removed from the string, regardless of whether the key is pressed on the keyboard. This means that a sound continues to play even after the key is not pressed:
This enables us to achieve two effects. Firstly it means we can connect notes together which otherwise would stop playing, simple because the hand cannot maintain contact with the keys (because it needs to be elsewhere!). Listen to this extract, played without sustain pedal where the opening note played by the left hand stops immediately.
In reality this opening note should continue. The only way to achieve this is with the pedal:
Notice that the use of the pedal has, as mentioned, a second effect. Because all of the dampers are removed from the strings, it changes the tone quality of the passage. The notes that are played are sustained, but the overall effect is richer, because the vibrations from the strings being played also cause those notes not being played to ring in sympathy.
The soft pedal on a grand piano
This is sometimes also called the 'una corda' (literally 'single string') pedal because in old pianos each note would consist of two strings tuned to the same pitch. In normal playing the piano would hit both of these string in order to produce a single pitch. When the 'una corda' pedal was pressed, however, the hammer would hit just one of the strings. In modern instruments, however, there are three strings (except for the lowest range where the strings become too thick). When the soft pedal is played, only two of the three strings are sounded. This has the effect of making the sound quieter whilst also making the tone quality more subdued.
The soft pedal on an upright piano
The soft pedal on an upright piano works slightly differently. When it is pressed, it moves the hammers closer to the strings:
This has less effect on the tone quality but, because the hammers have less distance to travel, they hit the strings more gently, also reducing the volume. Here's a short passage on an upright piano without soft pedal:
And here it is with the soft pedal engaged:
So what is that middle pedal for??
The sostenuto pedal is, perhaps, the least understood of all. It enables a player to sustain a selection of notes, whilst other notes can continue to be played without sustain. If you have access to a piano with this feature you can try this out by playing a chord, pressing the middle pedal, releasing the chord and then playing staccato notes elsewhere. The original chord will continue, whilst the staccato notes will stop immediately. Here is a more technical explanation of how this works, together with a good example of a situation in which it might be useful: