Another usefull method is to build various parts of a sketch as functions.
A function is a blok of program code that can be called from another part of your program.
So if one of the sketches you want to combine contains a "block of code" you want to use, it's probably a good idea to turn that block of code into a function that you can call from your programs loop function.
This can be a concept that is hard to understand for programming beginners, but if you try it out by defining a very simple project with a function that does something very simple then you will get it.