How we cite our quotes:
When in disgrace with fortune and men's eyes,
I all alone beweep my outcast state,
And trouble deaf heav'n with my bootless cries (1-3)
When the speaker says he's "in disgrace with [...] men's eyes," he means that all the men in his life disapprove of him and think he's a loser. So, we're kind of getting the idea that our speaker doesn't have any pals because everyone seems to be standing around hating on him. What's more, not even God wants to be this guy's friend because he's not answering our speaker's prayers.
Wishing me [...]
like him with friends possessed, (5-6)
We kind of suspected our speaker doesn't have any BFF's, and now we know for sure, because line 6 is pretty clear. Dude doesn't have any friends and he really wishes he had some. By the way, in Shakespeare's day, (male) friendship was a huge deal and was considered one of the most sacred and important bonds. In a famous book published in 1531, The Book Named the Governor, Thomas Elyot writes that "he semeth to take the sun from the world, that taketh friendship from man's life."
Yet in these thoughts myself almost despising,
Haply I think on thee, and then my state,
Like to the lark at break of day arising
From sullen earth, sings hymns at heaven's gate (9-12)
This is a major turning point for our speaker. Just as he's thinking of all the reasons why he "almost" hates himself, he suddenly realizes that, actually, there is someone special in his life: "thee." Okay, who is "thee"? Well, given that our speaker has been boo-hooing about how he doesn't have any friends (5-6) and is all alone (2), it's not unreasonable to argue that he's thinking of a pal here, right? That said, nobody's going to stop you if you want to try a different argument because, hey, what do we really know about this "thee" person? Well, we know that the memory of "thee" is enough to pull our speaker out of a deep depression and make him feel like a bird (a "lark") that sings to high heaven. So what? Well, earlier in the sonnet, we saw how the speaker felt despair because God seemed to be ignoring him (3). But here we see that the memory of his friend makes the speaker feel like he can sing "hymns at heaven's gate." These lines suggest that the speaker's friendship with "thee" is what functions as his spiritual salvation, not God. That's a pretty astonishing statement, don't you think?