You can also use Tabs within the IDE, the button for them is over on the right hand side.
For larger programs, I make a few:
main tab is the file name, I put some note there.
then a_presetup, all the # stuff, pin assigments, variable declarations
b_setup, this is void setup
c_void, the main sketch, maybe broken up also
d_more_void for example
e_functions
f_more_functions
sometimes I'll have a tab with just
void loop()
{
and then later
}// end void loop
so that CTRL-T, autoformat, will work correctly on the intermediate tabs and not choke on a missing { or }