There is a Visual Studio quick action, Extract to Section, available for the selected code that you can optionally apply. This quick action creates a new section in the file opened in the editor and moves the selected code to it.
To apply the action:
Executing this command replaces the selection a perform new-section statement. It also adds a new section called new-section.
The name of the new section is highlighted in the editor and the IDE displays the Rename: new-section widget enabling you to change the name of the section right away.
The name is automatically updated in the two places where it is referenced.