Spanners (which are also often known as wrenches in some countries) will only do a job properly if it’s the right size for the nut or the bolt to be turned.
The size used to describe a spanner/wrench is the distance across the flats of the nut or bolt to be turned. There are two systems in common use, metric, in millimeters, and imperial, in inches. Each of the systems has a range of spanners/wrenches especially made for each one. The systems can be identified on the spanner/wrench by either a number for metric spanners, or a fraction followed by A/F.
Another system once widely used in the United Kingdom was the Whitworth system. It used fractions but they did not refer to the distance across the flats of the fastener. Some older British and Australian machines use Whitworth-size fasteners. Some Whitworth sizes are not interchangeable with metric or Imperial systems.

There are many types of spanners/wrenches.
Choosing the correct one to use to do the job usually depends on two things: How tight is the fastener? In other words how much force is going to be applied to it, and, how accessible is it? - how much room is there to get the spanner onto the fastener, and then turn it.
When being used it's always possible a spanner/wrench will slip. Always try to anticipate what will happen if it does before putting a lot tension onto it. If possible, always pull a spanner/wrench towards you rather than pushing it away.

Ring spanners grip a fastener at the corners just like a socket spanner, just the sort of grip that is needed if a nut or bolt is very tight. Ring spanners have different sized heads at each end. They aren't as convenient as sockets but can fit into places that a socket can't. One disadvantage of the ring spanner is that it can be awkward to use once the nut or bolt’s been loosened.

Open end spanners/wrenches slip easily and quickly onto fasteners, and that's particularly important for nuts and bolts in awkward places. The angle on the head allows it to be used in two different positions. While an open-end spanner often gives the best access to a fastener, if it's extremely tight the open-end shouldn't be used as this type of spanner/wrench only grips across two flats. If the jaws flex slightly or the flats don't fit tightly between them, the spanner can suddenly slip when force is applied.
The best way is to use a ring spanner to break such a bolt or nut free, then the open-end. The open-end spanner should only be used on fasteners that are no more than firmly tightened.

The combination spanner/wrench provides the user with the best features of each of the other types. It has a ring on one end for gripping and breaking the fastener's hold, and an open ended spanner of the same size on the other end.

A variation on the open end head is the flare nut spanner. It gives a better grip because the flats meet on 5 sides, not 2. The open 6th side lets the spanner be used on nuts and fittings associated with pipes and tubing. Don't use the flare-nut spanner on extremely tight fasteners as the jaws may spread, damaging the nut.

There is another type of universal adjustable open end spanner/wrench in use. Usually referred to as a shifting spanner/wrench or simply "shifters", the lower jaw can be moved to fit any fastener size within the spanner range. Shifting spanners should only be used if the correct sized spanner is not available. Both the fastener and spanner could be damaged if they are used on really tight bolts or nuts