For example, for the sorcerer class in the list of spells by classes in the handbook, there is a section called "Cantrips (0 level)" as well as the list of 1st level spells. For my four cantrips, can I choose from either list or do I have to choose from the spell list? Thanks in advance.
Cantrips are Cantrips, First level spells are First Level spells
And as a Level 1 Sorcerer, you get four Cantrips you know how to cast, and two 1st level Spells you know how to cast. Cantrips are a special category of spell that do not require a spell slot to cast.
A cantrip is a spell that can be cast at will, without using a spell slot and without being prepared in advance.
The Sorcerer's Spellcasting feature says:
At 1st level, you know four cantrips of your choice from the sorcerer spell list. You learn additional sorcerer cantrips of your choice at higher levels, as shown in the Cantrips Known column of the Sorcerer table.
Thus, you look through the list of Cantrips (also called Level 0 spells) available to Sorcerers and pick four of them. If you look at the Sorcerer Table, you can see times where the number of Cantrips known goes up. You may learn new Cantrips at that time.
Your feature also says:
You know two 1st-level spells of your choice from the sorcerer spell list.
The Spells Known column of the Sorcerer table shows when you learn more sorcerer spells of your choice. Each of these spells must be of a level for which you have spell slots.
So, again, you go through the list of 1st level spells available to a Sorcerer and pick two.
Important to note is this: When your 'number of cantrips known' count goes up, you can only pick a new Cantrip. When your 'number of spells known' goes up, you must pick a spell that you have Spell Slots for. Importantly, because Cantrips do not use spell slots, they cannot be chosen as "Spells Known," only as "Cantrips Known."