How to connect contact with account

How to connect contact with account

How do you reliably connect an account with and a contact?

The only example i saw is to updated the "Account_Name" property on the contact. But Account_Name is not unique. If i have two accounts with the same name i can only assign contacts to one of them. Is there a way to link contacts to accounts by the account_id instead?