The first figure, e.g. the '8' in '8x40' is the magnification. Some people seem to think that this figure should be as high as possible. However, this isn't true. If the magnification is too high, it's very hard to locate the object you want to look at and even harder to hold the binoculars steady enough to view it easily. For your purposes, a magnification of 8 or (at the most) 10 should be about right. (You can buy zoom binoculars, which let you vary the magnification, but these are quite difficult to get used to. Fixed magnification binoculars are easier to use).
The second figure is the diameter (in mm) of the front lens. It's effectively a measure of the brightness of the image. (e.g. 8x40 binoculars will provide a brighter image than 8x25).
There's much more detailed information, here:
http://www.opticsplanet.net/how-to-buy-binocul ars.html
Chris