I always mess up with my writing by adding commas and full stops (periods) in the wrong places. Is there any rule of thumb or some other way that I can follow to avoid this problem?
ElendilTheTall has great advice regarding placing commas when you pause when reading a sentence aloud. The only thing I feel needs to be added to that answer is to not overuse commas; that is, don't use a comma when you need a period.
Each sentence sentence normally should not have two main clauses separated by a mere comma. For example:
I love to eat ice cream, on hot summer days I always buy some.
This is incorrect, because there's two distinct thoughts and two verbs here ("I love" and "I buy"). The correct version would be:
I love to eat ice cream. I always buy some on hot summer days.
Alternatively, since these two thoughts are closely related you could use a semicolon instead of a period:
I love to eat ice cream; on hot summer days I always buy some.
Note how in this case you would not capitalize the letter after the semicolon, because it is not the first letter of a new sentence.
EDIT 2: User psmears pointed out another error in my explanation; my explanation was too simplistic and excluded some perfectly acceptable sentences. You can join two main clauses with a coordinating conjunction. User psmears gives the example,
I like Mary and I hate John.
In this case there's two clear main clauses, each with their own finite verb ("like" and "hate"). However, while this is perfectly acceptable for short, closely relayed clauses, it can quickly lead to run-ons if you're not careful:
I like my coworker Mary from the accounting department but I hate my other coworker John from engineering because John always thinks he's better than everyone else and he always corrects other people's grammar but I really don't think he speaks very well and when someone criticizes other people for something they themselves are guilty of that's called being hypocritical and I don't like people who act like that.