1). Read a lot
2) Write a lot
Those are the only rules you need.
You’ll be inspired in terms of ideas, and your writing style.
You’ll realize the things you don’t want to do in your writing. I’ve learned about quite a few pet peeves through reading.
You'll research the things you need to.
And of course, exercise your mind, gain new ideas and perspectives, and just in general become better the more you do it. Not to mention all the awesome things that come with escaping real life for a while.
The more you write, the more you’ll develop your own style and learn what rules actually work for you. Learn the rules. Try following them. Try breaking them. I don't particularly like writing exercises or prompts, but some people find them very helpful. Give them a try. Then work on something that's just yours. Try everything, and make a habit of writing often. Like anything else, the more you write, the better at it you get. So, my main point here is to try new ways of writing to figure out your own rules. Because writing is so personal, you won’t know what rules work for you until you write… a lot.