In your first sentence the comma is optional.
In your second, either of the two examples you have used are fine. Which you use is a matter of emphasis.
The first commenter and I obviously had grammar teachers with very different opinions. I agree that the first sentence does not need a comma but the statement, "All the comma represents is a pause in speech," is misleading.
You are evidently aware of the function of a comma but writers in English are notoriously ignorant and they do exactly as the commenter suggests. They evidently read along with their writing and throw in a comma whenever they pause to take a breath whether a pause is required or not. At best it makes the writer look ignorant and confused, at worst it makes the message confusing or even reverses the writer's intent. Thank goodness for editors.
If it rains, I will need an umbrella.
"If it rains" is a short introductory clause. It is usually a matter of style to include or omit a comma from a short introduction. If there is room for confusion a comma may be required. Here's an example of how the presence or absence of a comma changes meaning.
Sadly, he walked away.
Sadly he walked away.
In the first the speaker is sad than a man walked away. In the second a man walked away in a sad manner. The second would normally be written "he walked away sadly" but the way I have shown it could exist in a poem. Poets love doing things like that.
You have correctly identified the natural breaks of your second sentence and you have put commas in good places. Which you choose to use is not simply a matter of style but one of emphasis.
I know that, if you do this, you will not regret it.
draws more attention to the conditional if than does
I know that if you do this, you will not regret it.
A speaker probably would pause at each comma but their purpose is to set off the clauses. A sentence that starts with a subordinate clause requires a comma and no matter how you break it up, that sentence starts with a subordinate clause.