I wanna combine sketches but i don't know how to

Be sure there is no pin conflict between codes.