Q:

Edit post or let them edit: which is best?

Consider that I found one post (let it be an answer) with silly mistakes/errors, or not well-formatted code. In such case, what action should I take? Format it, or let them format by indicate the mistake in a comment?

A:

Silly mistakes and errors:
Comment, and/or downvote.  
Fixing a mistake in a question may inadvertently hide the problem that the OP is trying to solve.  
Fixing a mistake in an answer is dangerous; are you absolutely, totally sure that your fix is correct? You're putting words into the answerers mouth. 
For example, an answer may be using an outdated library - but maybe the asker explicitly pointed out that they were stuck with this legacy library. That's the kind of thing you should check before trying to improve someone else's answer.
It is much safer to post a comment. If the comment gets a lot of upvotes and no counter-comments, then you may consider editing it in. Even then, it will be a controversial action, so make sure you know what you're doing.
Formatting problems:
Edit them out. But make sure that they're really formatting problems, and not just a change to match your preferred style of formatting.  

A:

As you indicated, you have two options: make the edits yourself, or leave a comment asking the post's owner to do it. Both are valid options; with the first one, you know you'll be leaving the post in good quality; with the second one you depend on the post's owner, who might not be able, or not willing to make the improvements (because he/she is lazy, or he/she doesn't understand the importance of formatting).
If you have somebody who aspires to be a well-behaving Stack Overflow citizen, the second method will teach him to fish. So it has definitely more potential than the first method, especially when used on a relatively new user.

