First off, if you’ve been named executor, you must first decline the role if you feel that you’ll be unable to carry out the responsibilities. In order to do that, you simply have to send an official declination form to the corresponding probate court where probate will be carried out, officially declaring that you’re renouncing the position of executor, including all authority and responsibilities that accompany the role.
In most cases, you’ll be able to find the renunciation form online, on the website of the probate court in the county, state, or province where the estate is being probated.
What happens next depends a bit on the rules and regulations of the jurisdiction where the estate is to be probated. If the will names an alternate executor, then that person may take on the role if they desire. If no alternate is named, then whoever is next of kin after you may petition the court to act as executor.
However, if no one wishes to act as executor, including close friends and distant relatives, then the court may nominate a creditor to the estate as a potential executor. But if there are no creditors, creditors don’t wish to fulfill the role, or you and the estate’s beneficiaries don’t agree with the nomination, then you have a couple of other options at your disposal.