I'm a foreigner, and I had to learn English grammar together with the English language. I still stumble, mostly on articles. And I still study it, to get better.
Grammar is part of your writer's toolbox.
How can you expect to write well if your tools aren't as sharp as they need to be, and if you don't know how to use them?
Yeah, yeah, yeah. Every teacher told you this, probably since elementary school. And yeah, grammar is hard, and learning how to use it right sucks.
However, when you master it, your writing will improve dramatically. You'll have choices in your prose you haven't seen before, and you'll stop worrying about little things.
It's like with any skill. Ballet dancing comes to mind, since I'm taking classes right now.
You begin with very simple steps and simple arm movements which you master, then you combine them into a glorious whole, you speed it up, you time it with music, you combine it with artistry and expression, and you've got it. Right now I'm still learning my ballet steps, and so I can't focus on my artistic presence because I don't know what my arms are supposed to be doing while my legs are moving in all directions!
Same with writing.
Here are some of my favorite books on grammar:
The Elements of Style
The Elements of Eloquence
The Deluxe Transitive Vampire
What are yours?