An article in The Atlantic reports that you probably learned grammar the wrong way -- if you managed to learn it at all.
A century of research shows that traditional grammar lessons—those hours spent diagramming sentences and memorizing parts of speech—don’t help and may even hinder students’ efforts to become better writers. ...
Just as we teach children how to ride bikes by putting them on a bicycle, we need to teach students how to write grammatically by letting them write.
I was an insatiable reader as a child, so I learned almost all my grammar, spelling, and punctuation from books. I parroted and reinforced the mechanics of what I read every time I wrote short stories and reports for fun or class assignments. I was lucky to have had so much access to literature and such encouragement to read and write, because it made my English teachers' jobs a lot easier. My English was never perfect, but it was usually pretty darn good.
Since I graduated from college, my writing is no longer graded, corrected, or edited as frequently as it used to be (for example, no outside parties critiqued this blog post before I published it). I also find less time to read. As a consequence, my learned intuition of proper written English has deteriorated. Now I must turn to the Internet for answers to spelling, usage, grammar, and punctuation questions that I used to know by heart.
If the research cited in this article is correct, then one of the best ways for you and I to improve our grasp of grammar is to make more time to read and write. I think I can do that. How about you?