Log into the Twitter Developers section.
Go to "Create an app"
Fill in the details of the application you'll be using to connect with the API
Click on Create your Twitter application
Details of your new app will be shown along with your consumer key and consumer secret.
If you need access tokens, scroll down and click Create my access token
By default your apps will be granted for read-only access. To change this, go to the Settings tab and change the access level required in the "Application Type" section.
To get the consumer and access tokens for an existing application, go to My applications (which is available from the menu in the upper-right).