How do I write two programs into one

i wrote two indivisual programs for my stepper motor and IR sensor, now i wanna know how do i put them in one single program so that i can use them simultaneously. I was initially just trying to write individually so that they work with no complications. can some one give me an example or something. :confused:

Since you do not provide any code, I will not provide any code.. But please look at this!

Merging code.
Combine Arduino sketches