If you buy a domain name that contains somebody else's trademark, then you will have trouble. From your example CocaCola could sue you for trademark infringement, and they would likely win. You would be forced to pay damages and give up the domain name.
At a minimum, you should check your domain yourself by searching the words in it to see what is already out there. You should be especially wary of trademarks that don't have other meanings. You can register domains that contain "apple" in them without being sued by Apple Computer (as long as the site can't be confused with Apple computer and isn't competing with them.)
There are trademark lawyers that will be happy to assist you with this process. They know how to use the trademark search database. They also have expertise in determining what would or would not be "confusing". The cost of hiring a lawyer to do a trademark search is likely to be several thousand dollars.
Assuming that your domain name does not violate any existing trademarks, you might then want to trademark it yourself. You can register your trademark for a few thousand dollars per country. Again, a trademark lawyer would be able to assist you with this process.
Even if you decide not to register your domain as a trademark, you do have some protections just from using it. This is called common law trademark and can protect you to some degree if somebody else decides to use your name in an inappropriate way.