You apply to ICANN. The registration paperwork and associated work will be fairly expensive, figure on spending $1M for a relatively uncontentious proposal, like maybe you want .pier25 that seems plausible unless there's some big community out there which feels they own it (see .amazon)
There are two routes, the key differentiator is are the resulting name hierarchy public (like .com) or is it yours and jealously to be guarded from all others (like .mil) ?
If the former ICANN will also require you to do a bunch of legal work to ensure that when you fail (because realistically you will) any names can be scooped up and preserved by a new operator of the TLD.
If the latter you're likely to have a tougher time defending why you should own this, unless you're a huge global brand.
Then you need to either spend a lot of money (again estimate $1M a year at least at first) yourself on infrastructure to serve your TLD, or you need to pay somebody else with relevant experience to do it for you.
A surprising number of companies bought vanity TLDs which they then don't use at all because of course they're much less convenient than a short name in an existing TLD. For example the KerryProperties TLD isn't used at all, kerryprops.com is much easier.
$ whois goog
% IANA WHOIS server
% for more information on IANA, visit http://www.iana.org
% This query returned 1 object
domain: GOOG
organisation: Charleston Road Registry Inc.
address: 1600 Amphitheatre Parkway Mountain View, CA 94043 US
address: United States
contact: administrative
name: Domains Policy and Compliance
organisation: Google Inc
address: 601 N. 34th Street
address: Seattle, WA 98103
address: United States
phone: 1 202 642 2325
fax-no: 1 650 492 5631
e-mail: iana-contact@google.com
Google also own .new which seems like the sort of ridiculously expensive experiment only one of the big startups with cash to burn would do. It allows you to type docs.new or sheets.new (etc) into your address bar and instantly get an empty document.
Sadly it always defaults to the first logged in user, which makes it almost entirely useless to me.