OK.
What you need is routing like this.
A MIDI track, which contains the MIDI (only MIDI, no audio).
An audio track with a synth in the fx bin.
The MIDI track's output pointed at the synth's MIDI input, which should show in the MIDI track's output pulldown menu.
The audio track should have it's output pointed to the master bus.
I'm not sure which version of Sonar you're using, but this should work.
Load a new project using the "normal" template. You should now have, amongst other things, a master bus which in turn sends to the soundcard. Go to the "insert" menu and select "soft synths" or to the browser's synth tab and click on the + button and pick a synth. I suggest one included with Sonar because it'll be easiest for the collective mind to provide help with one of them.
In the window that pops up choose the options for a MIDI track and first synth output (not instrument track).
That should create two tracks, a MIDI one and a stereo audio one with the synth loaded into the audio track. The routing should be set up correctly for you.
If you then enter some notes into the MIDI track using piano roll editor or step sequencer you should get sound out of the synth. If you are using a MIDI controller such as a keyboard you need to make sure Sonar has picked it up as a MIDI device and activated it, then select the controller's output port as input to the MIDI track. To hear it while you play you need to enable input echo on the MIDI track which should happen automatically when you focus on the track (unless it's been turmed off in preferences).
Working through the MIDI and soft synth tutorial sections in the help can be very useful when you're at the "how does it work" stage as well.