First, please look at the following sentence.

"It started 6 months ago".

Can I change like this? "It started 6 months earlier"

If not, could you explain to me why I can't use "earlier" instead of "ago"? ( I think the meaning of "earlier" is the same as that of "ago". eg) what time did you arrive here?
20 minutes ago! ( 20 minutes earlier!). Am I wrong?)

Thank you for your answer in advance.
"Ago" and "earlier" are definitely not interchangeable. "Six months ago" means six months before the current time. "Six months earlier" means six months before some other event that has just been described.

Six months ago, I bought a new car. Six months earlier, I had started saving for it.
This means I started saving 12 months ago, then bought the car after saving for six of those months.
Students: We have free audio pronunciation exercises.
Thank you for your teaching,Mr.DMW
You should've come here ten minuties ago.

I think in this sentence, 'ago' and 'earlier' are interchangable.
I don’t know the difference between both.
Teachers: We supply a list of EFL job vacancies