We should first understand that God had His Word recorded in such a way that it could be misunderstood. Through one of the prophets, we find that the Bible is written "here a little, and there a little" (Isaiah 28:10). That is, each part is true, but the whole truth about a particular subject may not be found in any one verse or chapter. This is one reason Paul said that the Word of God must be rightly divided (II Timothy 2:15).
By putting the two accounts of Judas' death together we get a clearer idea of what happened. Both events are true, but they did not happen at the same time.
Matthew writes that Judas "hanged himself." Luke explains what happened later, after Judas' body began to decompose. The corpse slipped from the rope, "falling headlong, . . . burst open in the middle and all his entrails gushed out"—the ignominious, yet deserved end of "the son of perdition" (John 17:12).