Add an instrument to your project by clicking "+" on the left of the control bar to add a new track. Select "Instrument Track" from the pop-up menu. Choose a virtual instrument to add.
Choose a sound preset for your instrument. This step will vary from instrument to instrument. Check documentation for your specific product, or try accessing help files by pressing "F1" while the instrument window is open.
Use a MIDI input device like a keyboard or other controller to record a MIDI performance using the voice of your virtual instrument. Alternately you can step-record data using a mouse. Refer to SONAR help files for steps to use either of these data entry methods.