I'm going to piggy back on this post because I was struggling with a similar problem in a short piece I did for character development.
I have a hacker type character hacking into a server. He's at home, alone, in front of his computer. During the hack, another 'entity' starts talking to him through the connection.
I have several 'types' of dialogue to try and differentiate.
First, the text that appears on the screen that the MC is reading from the entity. In general, any text being read off a screen I usually put in italics, so I did this for the entity's side of the conversation.
Now I need to figure out how to format my MC's thoughts, which I would also normally do in italics. I also need to format the text that he's typing on his keyboard to communicate with the entity. And finally, I need to format anything he might actually say out loud, even though he's home by himself. It's pretty safe to use regular quotes for anything spoken out loud, but otherwise I got pretty hung up with "he thought"s and "he typed" and things of that nature. Using italics in all cases apart from anything the MC said out loud seemed a bit confusing though.
It's not really an urgent problem for me, because I'm not really planning on doing anything substantial with this piece, but it did make me think about how to format something like this in case I decide to use it in the future.