This is called "merging", and there is not a specific set of instructions that would effectively apply to every instance of merging you would need to do...
The best advice that I can personally give to you is to first learn the programming language & how to effectively think like the computer & write algorithms for the computer to follow.
You can learn a programming language- the different data types, syntactic sugars, the different functions, how to use events & delegates, etc..
But until you learn how to apply those tools towards an actual product that accomplishes something, you will not understand how to "program"
Think of it in terms like learning a language...
You can learn the words "dog", "park," and "frisbee"
Learning how to write an algorithm with those words would be to create the sentence "I took my dog to the park to let him play with his frisbee"
You have to learn how to structure & finagle your way to a working set of programmatic instructions to get the end result that you want.
Take up small projects & complete them, etc..