Sherlock Holmes, one of the greatest detectives ever created in the world of fiction, described the mind as an attic. The more you store in it, the harder it gets to retrieve what you want. As a result of that, Sherlock never busied himself with certain sciences or pop culture. Doing so spared him clutter in the attic.
To become a solid writer, or person for that matter, keep your mind fresh. Populate it with wholesome content. Glance through encyclopedias, watch TED talks, and read articles from reputable sources. At the same time, avoid gossip, doomscrolling, and unproductive information that slowly amasses in your mind.
If you wake up every day and immerse yourself in enriching habits, you will soon see strides of improvement in your thought processes. And that eventually shapes better writing.