The Lord commanded His heavenly court to give comfort to His people on earth. This "comfort" does not mean feeling good and indulging in "creature comforts," but being freed from slavery to a pleasure-seeking lifestyle (see Is 40:2). God's comfort is not an exterior gratification of the senses but an interior freedom from sin and guilt (Is 40:2).
An angel obeyed God's command to comfort His people by crying out: "Earthquake!" (That is probably what is meant by the reference to filling in the valleys and laying low the mountains in Isaiah 40:4.) A voice screaming "earthquake" does not seem comforting, but it shows that God's idea of comfort is not based on circumstances.
Next, another voice, probably that of an angel, commanded Isaiah to cry out. Isaiah was understandably at a loss for what to say. He was told to cry out that "all mankind is grass" (Is 40:6). What a comforting thought! Obviously, God's comfort is not based on human power.
Finally, Jerusalem is told to climb a high mountain and cry out at the top of her voice: "Here is your God!" (Is 40:9) Comfort isn't a feeling, pleasure, circumstance, or human accomplishment. No matter what the circumstances, true comfort is being in the Lord's presence and in a committed relationship with Him.