This is a rather broad question! A soliloquy is a speech or monologue that a character gives when no one is listening but the audience. In the case of Hamlet, one soliloquy is given when he thinks no one is listening. This occurs during the famous "To be or not to be" soliloquy at the beginning of Act III. He doesn't realize that he is being spied upon by Polonius and Claudius. Still, the results are the same. In all four of Hamlet's soliloquies, the audience receives an inside look into Hamlet's suffering head.
Hamlet's thoughts during his soliloquies cover many different aspects of his life and the events that have taken place. In the first, Hamlet laments over the fact that his mother has married his uncle, crying "Frailty, thy name is woman!" He also discusses suicide in this first one, but not quite on a personal level. At the end of this speech he says "break my heart, for I must hold my tongue." He is upset because he suspects all of these horrible things regarding his father's death, but he can't say anything or do anything about them. In the second soliloquy, Hamlet discusses revenge and his cowardice at not doing anything about what he now knows was the murder of his father. The "To be or not to be" soliloquy finds him discussing suicide primarily. And finally, in the fourth soliloquy, he berates himself for his inaction and vows that "from this time forth, my thoughts be bloody, or be nothing worth."
In all, the soliloquies offer much needed perspective into Hamlet's thoughts for the audience.