USING "TO" FOR PURPOSE
The preposition "to" is used to show intention. Examples:
I went to the bank to pay a bill.
She called me to invite me to a party.
Notice that the second "to" in the second example above is used to show direction or destination.
Now pay attention to the following examples below:
Where´s the key to my car?
I can´t remember the number to my savings account.
Those are confusing for Brazilian students because in Portuguese we would use "of" instead of "to":
chave do carro = key to the car
número da conta = number to the account
The confusion stems from the fact that the translation to Portuguese for "to" is usually "para" and for "of" is "de"
But have in mind that the purpose of the key is to open the car. And you need the number to use (make a deposit or withdrawal or transfer) the savings account