Grammar represents the building blocks, the structure of the language. Don't listen to people who tell you you shouldn't learn it. What you shouldn't do of course is to learn the rules by heart and have to recite them in your head before being able to get a sentence out. Grammar exercices, lots of them, though are very effective.
"Eating" grammar exercises
Here is the way to go : quickly read the rule and then, as one would say in French, "eat" exercises, lots of them. Make the grammar rules become intuitive, second nature, through repetitions. Apply them, apply them, apply them.
When you learn vocabulary words, the best tactic is to learn them in context, in the middle of a meaningful text or speech. Learning long lists of words, one dry word after another, is not only not that effective, but it's also quite boring. With grammar, it's the same game. Put grammar rules in context by applying them in lots of exercises and you're quickly going to be able to speak more easily.
GRAMMAR EXERCISE TIP
Find grammar exercise books or language games that YOU LIKE. Sounds like a sure thing, but let me insist because it's so easy to go for what you think it takes instead of for what is fun : when you buy an exercise book or subscribe to an online language learning program, only do so if you can foresee the fun (or satisfaction) you'll get using it.
Giving up on a grammar difficulty is OK
Sometimes, grammar is just there to give you a headache. It may not be a difficult rule to understand, but it may be one that is added to so many other awful little ones that you eventually don't know which one to apply. I personally encounter this problem with languages that add suffixes to words. I find those terrible and I thus heavily rely on the “I'll eventually get it, let's give up for the moment” mantra.
WHEN TO GIVE UP ON GRAMMAR
Read the examples first. Do you see a scheme ? Could you create this kind of sentences with other words ?
Yes => absolutely skip reading the grammar rule ! You don't need it.
No => read the grammar rule to understand the examples and directly go do something else. Don't dwell on it, you'll encounter that difficulty again.
In any case, keep cool ! Learning a language takes time. Skip what's too much of a headache, go learn some other little piece of the jigsaw puzzle. You'll eventually get it all together.
My personal experience with grammar exercises
When I was younger, I took a few English tests like the TOEFL or the SAT. The thick textbooks that help prepare for those tests are filled with grammar exercises and my English is forever grateful for that.
(As a sidenote, let me say that what I learned in those textbooks, the logic and other transversal skills, was more valuable than all I learned subsequently at university.)
Presently, I am perfecting my Spanish automatisms and here is the textbook(1) I use :
Por or para, that is the question for me at the moment !
Again, grammar is rendered in-context by exercises. So, grab your textbook and start to scribble right now. If you like learning languages, it can even be more fun than sudokus !
(1) Aprendre gramática y vocabulario 1 – Francisca Castro Viudez – Sociedad General Española de Librería