What is the difference between κόσμος used in the New Testament (e.g. John 1:9f) and אֶרֶץ (erets meaning earth, land, dirt) in the Old Testament (e.g. Genesis 1:1f)?
אֶרֶץ - Earth goes from the planet downward, Promise Land, Land of Egypt, down all the way to dirt. κόσμος goes from the planet upward to the universe with the root idea of order.
While Genesis 1:1 means the planet Earth (κόσμος could have included both the heavens and the Earth), it appears that the difference when viewing the planet Earth is the emphasis in the Old Testament on geography, such as the Promised Land, while in the New Testament the emphasis is on people. Greek has the word γῆ, used in the Septuagint to translate אֶרֶץ. In the Septuagint κόσμος is seldom used for world (cosmos, cosmology), but is more often used with the meaning of ornamental (cosmetic, cosmetology).
κόσμος has obviously different meanings as used in the New Testament. For example,
For God so loved the world, that he gave his only Son, that whoever believes in him should not perish but have eternal life. 17 For God did not send his Son into the world to condemn the world, but in order that the world might be saved through him.
The Holy Bible: English Standard Version. (2016). (Jn 3:16–17). Wheaton, IL: Crossway Bibles.
Do not love the world or the things in the world. If anyone loves the world, the love of the Father is not in him. 16 For all that is in the world—the desires of the flesh and the desires of the eyes and pride of life—is not from the Father but is from the world. 17 And the world is passing away along with its desires, but whoever does the will of God abides forever.
The Holy Bible: English Standard Version. (2016). (1 Jn 2:15–17). Wheaton, IL: Crossway Bibles.
To be fair to the Old Testament, it focused on people in a nation (related to the Promise Land) and did not primarily focus on the people in the entire world.
One more detail. Here's a word translated world in the Old Testament, but realy more like אֶרֶץ:
†תֵּבֵל S8398 TWOT835h GK9315 n.f. Na 1:5 (appar. m. Is 14:17) world, poet. synon. of אֶרֶץ (perhaps orig. as productive, cf. יְבוּל, בּוּל, but this sense not clearly maintained;
Brown, F., Driver, S. R., & Briggs, C. A. (1977). Enhanced Brown-Driver-Briggs Hebrew and English Lexicon (p. 385). Oxford: Clarendon Press.