Question: There seems to be a great difference in the translations for Matthew 26:50.
And Jesus said to him, "Friend, do what you have come for.” (NASB)
But Jesus said to him, “Friend, why have you come?” (NKJV)
It seems as if these are two completely different translations. Is there a correct one and which one is it? Also, what is the reason for italics to be used on words?
In the original Greek, the phrase in Matt 26:50 can actually be read either way, at least at first glance. In the first century, they had not yet invented the question mark, or most other punctuation for that matter. They didn't even put spaces between the words! As a result, there are a few places in the New Testament where it is a little unclear whether we should read a question or a statement.
In Matt 26:50, there are a few hints that "do what you have come for" is more likely correct, although it's not a slam dunk. First, the way it is phrased works slightly better as a question according to normal Greek grammar. Second, in the parallel passage in John 13:27, where there is no difficulty with translation, Jesus says "What you do, do quickly."
Nerd note: the phrase in question is eph ho parei (literally, "for which you are present"). You can see why it could be read as a question: "For what are you present?" But there are no other examples in the NT or in the LXX of a question starting with the preposition epi (or eph), making it a little less likely. So the other option is an implied command: "do!" There are a few other places in the NT with implied imperatives.
If you do a little looking around, you can see that most modern translations choose this option. In general, I don't advise using the NKJV, at least for the New Testament. It's not really bad - not as if you will become a heretic by reading the NKJV! But the NKJV always follows the decisions made by the translators of the 1611 KJV, even when better ancient manuscripts are found, or when scholars have learned more about how Greek works. Modern translations like the NASB, NIV, NLT, ESV, NET and RSV are all better.
You asked about italicized words in the NASB. All translators occasionally have to add words that are implied in the original languages, so that the translation will make sense in English. The NASB translators decided to italicize such words, while most other translators leave them in the same font. By the way, this is not anything to be concerned about. In English, we regularly omit words that are obvious to us. For example, if I say "I like chocolate, but not butterscotch," I am leaving out the phrase "I do not like" from the second half of the sentence. Someone translating the sentence into another language might put "I do not like" in for clarity in the other language.
Bonus: Jesus calls Judas "friend" in Matt 26:50 (hetaire in Greek). Jesus has used this word twice before in parables (Matt 20:13, 22:12). In both cases, the speaker is implying that the "friend" has taken advantage of his kindness.
Another bonus: Jesus' disciples probably normally greeted him with a kiss as a sign of respect. Anyone who didn't know Jesus would guess that he was the rabbi by seeing his disciples kiss him. So it was a very obvious way that Judas could point out the rabbi to the waiting soldiers.
The picture: The Kiss of Judas, ca. 1308, by Duccio di Buoninsegna.