Well, you start by posting this in the correct forum.
Which version of SONAR do you have--Producer, Studio, Home Studio or LE? You'll see forums for the major versions of SONAR, and you can post this question there. (Don't worry about the version
number.)
That said, to "erase" what you don't want, you can simply "undo" (Edit/Undo), if it's recent enough, or you can go into the Piano Roll View (PRV) to see the notes and delete them.
If you want to delete entire tracks to re-record them, just right-click on the data you recorded and hit "delete".
If that doesn't help, you might want to be more specific with your question and post it again in the proper forum. That way, people who have the same version of SONAR that you have will be able to give you specific instructions on what to do.
Welcome to SONAR and to the forums. Have fun!