So the "um zu"-part has already been explained. When you can replace your "to" by "in order to" or rephrase to "because I want to ... " then "um zu" is the correct choice.
What I would like to add is a method to check for a simple "zu". Imagine a room full of people. You open the door and you say the first part of your sentence and then you leave. If you can do that without confusing everyone, it is probably "um zu" but if your sentence does NOT make any sense by itself, it is going to be "zu".
"I am trying."
Unless you have discussed whatever you are trying before, this statement is nonsense. It needs the "to"-part as completion and thus is followed by just "zu" in German.
"Ich versuche zu lesen."
"I am trying" is not complete. Now let's look at a sentence that is.
"I am going to the kitchen, (to get a beer)."
People might wonder who cares but still they are well-informed about your plans.
Ich gehe in die Küche, um ein Bier zu holen.
So when the first part doesn't make sense by itself, the "to" is mostly translated to "zu".
There is one more thing that needs to be mentioned. If you want to connect a modal verb like können or wollen with an infinite form, the "to" just disappears. For instance:
I want to eat.
Ich will essen.
I have to go.
I must go.
Ich muss gehen.
This also applies for gehen by the way.
"I go to the supermarket to buy milk."
According to the "in order to"-rule the translation should be:
"Ich gehe in den Supermarkt, um Milch zu kaufen."
This is correct but the following is also proper:
"Ich gehe in den Supermarkt Milch kaufen."
So here the "to" disappeared as well.