I am making a project and have two codes and need to combine them

@pushkarsaluja2008,

As others have pointed out the use of delay is the main problem in your code. Without a complete re-write to use non-blocking code without delay you are not going to fix this, and certainly not in 1 day. The tutorials you need to understand to re-write your code are on this forum and are commonly referenced for this kind of problem. The ones I suggest are:

This shows you how to handle serial data properly:

This gives examples of using millis for timing, no delays:

More about using millis:
Using millis for timing

Doing several things at the same time:
Demonstration for several things at the same time

Others might suggest other tutorials, but the point will be the same.

If you really need to finish this today you have to decide what to do, because you are not going to finish this today.