You can remember the meaning of 代替 with this easy mnemonic:
We need someone to replace the substitute (代) teacher we hired to substitute (替) the original teacher.
Using mnemonics to remember the meaning of Chinese characters like can have an enormous impact on how long to learn Mandarin it takes.