In Genesis 1, God starts with the creation of the heavens and the earth, but in Genesis 2, He begins with the creation of man; is there a contradiction?

Although the Scriptures may sometimes seem to contradict themselves, they are, in reality, completely harmonious.
The difference in Genesis 2 is that it marks the first appearance of God’s personal name יהוה (YHWH), which occurs 6828 times in the Hebrew Scriptures and is first mentioned in Genesis 2:4 in relation to creation. This name is the covenant name of God, symbolizing the promise keeper, the loving and caring Father.
It is no coincidence that His proper name first appears in the account of man’s creation. The Spirit of God places man at the center of this moment to demonstrate that humanity, made in His image, is the pinnacle of His creation.
Genesis chapter one provides the actual chronology, while Genesis chapter 2 gives us the theological order, showing God’s heart, purpose, and relationship with mankind.