Open a new project. Connect your MIDI controller to your computer. If you don't have a MIDI controller, you can use the keyboard that comes up in the track view.
Click on a MIDI track or create one by pressing Control + alt + Q. On the MIDI track header, select the icon that reads "MIDI Input:" when you mouse over it. Select "Auto" if you are recording on that track. Select the MIDI input channel. This is the icon with the keyboard and number below it. This determines which sound you will use.
Arm the track by selecting the "Arm for Record" button. It has a red circle on it. Now that track is ready for recording.
Put your cursor where you want to begin recording. Press the record button on your transport bar. Play the notes on your controller or on the keyboard in the track view.
When you are finished, press the "Stop" button or hit "Record" again.