Good grammar is essential for effective communication. The better the grammar, the clearer the writing, and the greater the likelihood that the reader will understand your message. After all, understanding each other is what communication is all about.
In turn, bad grammar can obscure your meaning and detract from the reading experience. There’s nothing worse for a writer than writing something and not being fully understood by the reader.
However, good writing doesn’t require perfect grammar, and I’d argue it’s better to be engaging, persuasive, and entertaining rather than a stickler for grammar rules. Keep in mind, though, that you can’t break grammar rules effectively if you don’t know them in the first place.