I was told to just get new chain and rear cassette and let them wear together
Not always, if you replace the chain often enough the cassette will last a long time, modern cassettes are good for around 5000 to 6000 miles, best to change the chain every 1000 if you can.
MTB is a little different due to the muck / crap etc but as long as you clean and wax (*) the chain after every ride it should last a long time.
*(proper chain wax, thin oil or chain lube are nowhere near as good)