The critical part is the layout or relative locations of files on the web server, or relative to whatever directory your html file is in on your PC.
That location is the "zero reference" for want of a better name, for all other files used in a page or that in any way link to it.
Your css link in the html section does not include any kind of directory path, just the filename. That means the main.css file must be in the same location (directory / folder) as the html file that uses it.
If you were trying to store it in a css directory located in the same place as the html file, the href would become "css/main.css"
If it was a parallel folder, as in the html files are in one directory and css in another, both in the same parent, then the href would be
"../css/main.css"
[double dot mean "parent of"; up a level in the directory structure from wherever you are].
Also be very careful to match filename and extension case - windows & windows programs don't care about mixing upper and lowercase in filenames but most other systems - and specifically normal web servers - are case-sensitive and everything must match perfectly.