In Act II scene 2, Hamlet says, "O, that this too, too solid flesh would melt / Thaw and resolve itself into a dew! / Or that the Everlasting had not fixed his canon 'gainst self-slaughter!"
What he means is that he wishes he could fade away--like snow melts and disappears. But since that is not likely to happen, he wishes he could kill himself. Just as in his "To be, or not to be" soliloquy, Hamlet is contemplating suicide. At this point, however, he does not go through with the act because the Everlasting, or God has fixed his canon, which means his law against it. In other words, Hamlet wants to kill himself, but he knows that suicide goes against the laws of God.
This contemplation of death is a major motif or recurring theme throughout the play.
E-notes has a side-by-side version of several Shakespearean plays available. The modern version of Hamlet for the lines you asked about reads as follows:
O that my too, too solid body would melt,
Thaw, and change itself into a dew!
Or that the Everlasting God has forbidden
Suicide! O God! O God!
How weary, stale, flat, and unprofitable
All the habits of this world seem to me!
See the link below for the entire sid-by-side e-text.