Gmail is a popular product from Google. It has its uses, but also its problems. Many people use it to the exclusion of any other form of emailing system and are dependent on it (monoculture is no good for the consumer). Others (like me) have had an account since around 2004 which has fallen into disuse after an initial trial (who knows what mail goes there). Still others will have some of their mail arriving at a Gmail address, some to a university address and some to an employer's address (it's a mess).
Whether you are trying to make sure that you aren't solely dependent on a single corporation for an important service, cleaning up an old mail account or trying to disentangle a mess; here is how to effectively and safely quit Gmail (or bring yourself to a state where quitting the service would is easy.)
Step one is to get an email address you can keep unchanged for long time, and be free to choose and change email service providers.
I bought my family domain name for a decade, bought some email accounts and associated those with email addresses in my family domain. Doing something like this is a good way of ensuring that your email address remains the same for a good length of time, which is very convenient. The decoupling of the domain name from the email service provider also means you can change email service providers while retaining the same address (it's even possible to go full-DIY and plug in an email service you run on your own servers, though admittedly not everyone has an appetite for server administration.) We'll call this address our long-term address.
Setup automatic forwarding of everything coming in through Gmail to your long-term address. Then setup a filter at your long-term address to drop all of that incoming mail into easily identifiable "Gmail" folders.
As the email comes in from Gmail, you'll be able to periodically scan the Gmail folders for stuff you don't want coming in through Gmail. Choose one or two of those, contact the service and change your email to your long-term address. The beauty with this method is that you have as long as you want do go through this process, slowly picking out important, personal or professional connections and migrating them one-by-one off of Gmail whenever convenient.
Whether a year of this process goes by or just a couple of months, eventually nothing important will be coming into the Gmail folders of your long-term address. At this point you can confidently and safely quit Gmail without losing sight of any important messages, or relegate your Gmail address to a throwaway email address you can give out whenever you'd really rather not provide your long-term address to a third-party.