Yes putting tea tree oil on cold sores is a good way to get rid of cold sores.
The tea tree oil has antiseptic, anti-inflammatory, and antiviral properties which kills off the bacteria and virus that causes cold sores.
So if you apply some tea tree oil to the cold sore daily then within a few days or so the cold sore should go away.
You can help prevent cold sores by increasing your intake of Vitamin C and eating healthy because your immune system will be boosted which means that you're less likely to get the virus that cause cold sores.
If someone else has cold sores then avoid kissing them because you can catch the cold sore from them.
Applying some toothpaste with mint in it can also help get rid of cold sores as well as applying some apple cider vinegar to the cold sore daily.
Even without treatment the cold sore will eventually go away on it's own within a few weeks or so.