Kinda beyond the scope of a quick forum post, it'd take that just to spec up what you'd be after.
First you'd need a domain. You can rent one of these from multiple providers, and depending on which TLD (Top Level Domain, the last section, ie: .com, .gov, .org etc) will depend how much this will sting your wallet, or which additional hurdles you will need to clear to obtain. Namecheap and ionos appear popular, as long as you don't mind sharing services with criminals as they seem to rent to anyone regardless.
Once you've a domain, 'standard practice' is to use 'subdomains' (the 'first' part of the section) to split off for different use-case, and there's a record specifically to handle Email, 'MX'. Create a subdomain in your provider's tooling with one o them and within a few moments the destination it links to should be reachable. Officially it can take up to 48hrs to propagate but I've never had to wait more than an hour.
Now you need to decide all the 'serious' stuff. Most critically 'where'. Local, or offsite.
Residential connections tend to have dynamic IP's which is a bit of a headache when it comes to making something point at something randomly changing, but there are solutions available, some providers can make this easier than others. Your ISP may be able to provide you a static IP, but this is more likely restricted to business lines.
Personally I'm using offsite as a nice datacenter will have far more stable power, and better connectivity than any residential setup. At consequence of enhanced cost. My dedi is a touch overkill, but it can(and does) other things, if you're comfortable with containerization keeping your machine seperate, a VPS is a lot cheaper and cunning shopping can pick you up a year for a tenner.
Once you have the 'where', 'how' becomes prominent. I've linux on my dedi, so a stack of dovecot and postfix gets most done, with a layer of apache and roundcube to give HTTP access. Tapping any of those names into a search engine should yield more than enough to get them setup, most 'work' will be the adjusting the configs to reflect your reality.
To address previous comments of self-hosted being instantly spam-binned, a lot of email providers instantly refuse any mail that isn't signed with SPF, DMARC, and DKIM. These additional measures help assure the recieved mail was sent from where it was claimed to, using cryptography, and assists with stamping out spam. You actually achieve this twofold, generating certificates and storing public halves in publicly accessible DNS records...