To transfer your server ownership to someone else, follow these steps:
Open the Discord App or head over to www.discordapp.com and sign in into your account.
Once signed in, open the Server Settings.
Under User Management click on the ‘Members’ tab:
Hover over desired user’s name & click the three dots to open a sub menu where you can click on ‘Transfer Ownership’.
Wait for the pop-up to verify that you want to transfer ownership. Then click the Transfer Ownership button to verify.
If a verification code arrives, either go to your email or go to your 2FA code and enter the given code.
After completing the transfer you will still be a member of the server. The access you retain will depend on the permissions tied to your role.