Witnesses might have another role in the marriage ceremony, such as the best man or a bridesmaid, or, being a witness might be your only role in the ceremony.
As a witness, you must be present when the bride, groom make the declarations and exchange vows. After the marriage has taken place the vicar and the couple sign the official marriage paperwork, and you are required to sign it too.
Virtually any responsible adult can be a witness – all that’s required of you is being capable of writing a signature, and understanding what you have signed.
Most witnesses are adults, but occasionally, a witness may be under 18. It is for the vicar taking the wedding to check this is acceptable in a particular case.