How do I exclude rows from sort function?

I use Calc to create task spreadsheets.
I want to be able to select all → Data → sort by ‘priority’ (for example) without sorting my headings or notes I’ve left.
These headings are contained to certain rows, so I think it should be possible to leave them out of the sort.
The easy workaround is just manually selecting everything except what I’m trying to leave out, but I’d like a more elegant solution.
Thank you!

You don’t need to select anything to initiate a sort. Just click on one of the cells within your spreadsheet and then go to Data > Sort and pick your desired sorting options.

Column headers don’t get sorted. Calc knows not to include these.

Calc groups together the entire row for sorting, so if your notes are in a separate column they will still remain with the row of data they pertain to. Cell comments, if that’s what you meant by ‘notes’ stay with their respective cells no matter what. If your notes lie outside the data in your spreadsheet, i.e. separated by empty rows and/or columns, Calc won’t include these in its sorting.

The LibreOffice documentation and help files are here English documentation | LibreOffice Documentation - Your documentation for LibreOffice. There are free online materials as well as physical books you can buy. You can also fool around with simple spreadsheets or make a copy of the one you are working on and play with those.