When you first start writing, you’re just so excited to get the words down on the paper, you aren’t paying attention to any grammar rules you learned in school. I’m the first to admit committing this crime when I first started out. I can’t even stand reading my first stories anymore. I broke every grammar rule known to man!
If you’re like me and don’t want to race out to buy a grammar book, something else you can do is to take a book you’ve read more than once and read it again. This time, don’t read the story. You need to pay attention to sentence structure and punctuation. But it’s more than grammar. Look at the plot, how was it put together? Characterization, how were the major characters introduced? Was it a mystery, were you able to guess the ending? Description, was there so much that you skipped ahead? Not enough, so you had trouble envisioning the scene?
There’s a wealth of information you can glean from just looking closely at other published books. I would also advise to look at multiple books from various authors. Every author has a different way of doing things and may have things that work for you. It’s a great way to learn more about writing before you break down and buy a Grammar for Dummies book like I eventually did in an attempt to better my writing craft.