“cause your whole body to sin.” In this context, “your body” is a graphic way of saying “you,” and many English versions omit “body” altogether and simply say “you” (cp. ESV; NASB; NET; NIV). It is likely that James was using this verse in Ecclesiastes as background when he pointed out that the tongue was evil, “staining the whole body” (James 3:6). The wise person carefully guards their mouth and does not let their mouth cause them to sin.
“the messenger.” This is perhaps the Temple priest because the temple was a likely place where a person would make a vow (the priests were messengers of God; Mal. 2:7). It is also possible that “the messenger” was some other messenger, perhaps a messenger from the person to whom the vow was made, inquiring why the vow was not fulfilled. The verse does not tell us exactly who the messenger is, and it is not important for understanding the verse. Angels were also messengers of God (the Hebrew word for “angel” means “messenger”) but “angel” is an unlikely interpretation here because how would someone tell an angel?
“it was a mistake.” That is, that the vow was a mistake.
“destroy the work of your hands.” This statement can be understood in the context. The person has made a vow, but for some reason cannot keep it or does not want to keep it. The vow almost certainly had to do with an exchange of some kind: “I vow this if you will do that.” But now the person who made the vow says he cannot (or will not) keep it, so whatever good he was trying to accomplish by making the vow will now be “destroyed.” The Anchor Yale Bible: Ecclesiastes, by Choon-Leong Seow, translates “destroy” as “take away,” and makes a good argument for that translation. If the person reneged on his vow, what he received as part of the vow would be taken away.