To start the Thieves Guild questline, you can either go to Brynjolf on your own or while completing the main story.
A Chance Arrangement*** Spoiler - click to reveal ***Talk to Brynjolf at the market place of Riften during the day so he gives you the details of your initiation. Tell him when you are ready and he will attract everyone attention to him. Once all are distracted, go behind Madesi's (the Argonian) booth, crouch and lockpick the lower drawer and the strongbox in order to steal the ring. Then, go pickpocket Brand-Shei (the Dunmer) and instead of grabbing anything from him, put Madesi's ring in his pockets. Wait for Brynjolf to finish his presentation and for Brand-Shei to get arrested and you are clear. Brynjolf will now suggest you go through the Ratway and meet him at The Ragged Flagon.
Taking Care of Business*** Spoiler - click to reveal ***You will first have to go through the Ratway and confront a few bandits before you make it the the Ragged Flagon. Once there, talk to Brynjolf and he will ask of you to retrieve the debts of three business owners. The debts have to be collected without hurting anyone though. For Haelga, you can either brawl her or steal her statue of Dibella as leverage for persuasion. The same goes for Bersi Honey-Hand, which can be brawled or convinced by breaking the Dwemer Urn under the window. For Keerava you will have to talk to Talen-Jei to get information on her family so you can threaten her. Hand back the collected gold to Brynjolf, who will take you to the cistern and introduce you to Mercer Frey, welcoming you into the guild.