Combine two Arduino projects into one PCB with the Arduino codes combined.

how do I make the first code have the parts of the second code to make the first code say, when ( what ever button they pressed), play tone_=_Hz