To cost the earth / To be very difficult
Can mean something is very expensive or that it requires enormous effort. Context makes the meaning clear.
That restaurant costs the earth, but it's worth it.
It took enormous effort for him to admit he was wrong.
—Was it hard? —It cost me the earth, but I managed it.