To correct what samarm said, it’s Mandarin that has four tones, steady, rising, descending, and down-up; Cantonese has 9 tones.
Some characters do indeed change meaning depending on context, owing to the natural drift of the language over time. Probably the most famous example of this is a character pronounced “ji”. The compound word “weiji” means peril, while “jihui” means chance or opportunity and “jixie” means machine. There are many others such as “zhiliao”, (medical) treatment, and “zhengzhi”, politics - both words are written with the same “zhi” character.
What’s important to remember, though, is that ultimately Chinese characters are independent of pronunciation. There are many, many different dialects and sub-dialects to Chinese and each will read the same text differently - though the meaning will stay the same.
In Japanese, there is a discipline called “kanbun”. It used to be taught fairly early on until WWII, and now still has a tiny spot in the senior high school curiculum. Kanbun consists in reading classical chinese texts with the Japanese reading of the characters. (I suspect the same thing exists in Korean and Vietnamese.) Buddhist prayers are still recited that way. Like the Heart Sutra:
“(…)Sha ri shi, shiki fu i ku, ku fu i shiki, shiki soku ze ku, ku soku ze shiki (…)”
In modern Mandarin Chinese it comes out:
“(…)She li zi, se bu yi kong, kong bu yi se, se ji shi kong, kong ji shi se (…)”
For English-speakers studying Chinese, getting the tones right is very difficult at first. However, and this should be obvious, this doesn’t mean native speakers have difficulty with them. Consider that to most Japanese the words “bath”, “bass”, “bus” sound exactly the same, just like “worm” and “warm” do.