[This page is outdated. See the new Project Tamriel wiki page instead: https://wiki.project-tamriel.com/wiki/Content_File_Guidelines#Merging_Plugins]
This tutorial will explain how to properly merge esp's into section files.
First, I'll go over how to load up a section file normally.
Here's what your load order should look like:
You should have the three vanilla esm's, Tamriel_Data.esm, the latest TR_Mainland.esp, and your section file loaded.
Note: If you are working on TR_Mainland, you can just ignore the stuff about changing it to an esm and removing the depencency on the esm because you are editing that file directly.
When you merge a file, the Construction set takes all esp's you have loaded and combines them into one esp, so you need to make TR_Mainland an esm using Wrye Mash
Once you have done that, you should have this load order:
Making one of the plugins the active file makes it load last, so you should make the file you're merging active. This doesn't really matter if you are merging an interior, but if you are merging anything with dialogue, you want that loading last, so make it active.
Then, you go to File -> Combine Loaded Plugins, enter a new file name, and your plugin will be merged into the section file!
After you have done this, your files are now just one file and you now have one last step, removing the dependency on TR_Mainland.esm from your file using Wrye Mash: (click the box then save)
Click the post-merge section file, click inside the box with the load order, click the check mark next to TR_Mainland.esm, click Save, and you are done!