This page https://www.gov.uk/cancel-visa explains your options, depending on:
If you were told to attend an appointment and have not yet given your fingerprints and photo
You can cancel your application online and your fee will be refunded if you have not yet given your fingerprints and photo.
If you were told to attend an appointment and have already given your fingerprints and photo
If you applied within the UK, fill in the online form to withdraw your application.
If you applied outside the UK, contact UKVI to withdraw your application.
Your fee will not usually be refunded.