Difference between "I will ____" and "I'm going to ____"?
Solution 1:
It depends when your friend said it.
I will go to sleep means that eventually you plan on sleeping.
I am going to sleep means you are currently in the process of "going to sleep".
Therefore, if your friend said "I'll go to sleep" and was not in the process of doing so, then he was correct.
However, if your friend was on his way to bed, or was on the couch attempting to fall asleep, then you were correct.
I'd also like to add that in casual conversation, people who say "I'm going to sleep" imply that they want to go to sleep (not that they're currently on their way to do so).