A fixed term tenancy is one with an agreed end date that is written into the Tenancy Agreement. The term can be any length and does not have to be 6 or 12 months. It can vary to suit both parties and as an owner it is wise to make sure the end of the tenancy is a peak time for finding new tenants. No point in having your rental property sitting vacant and not earning rent.
Can you get out of a fixed tenancy? Generally only by mutual agreement. If your tenant hands in notice to leave you do not need to accept the notice, but it can be a lot simpler to work with the tenant and agree to release them if a suitable tenant can be found as a replacement. The outgoing tenant pays rent up to the date when the new tenant moves in. It would be usual to have a day or two between tenancies to facilitate the final inspection and a proper clean. It is also usual for the outgoing tenant to pay reasonable costs of re-advertising the property and associated admin costs.
What if you want to sell the rental property? The new owner will take over the tenancy and see it through to its end date. If the purchaser does not want a tenant, you could try to negotiate a compromise with your tenant for example covering the cost of moving and their next letting fee.