You might want to look at this How to get the best out of this forum before you proceed any further.
We only know what you tell us, and without knowing what you have, we don't stand a chance.
This sounds like a classic case of you trying to do two things at once, but actually doing them one after the other.
The solution to this is to use a state machine as a time division multiplex program. That is you look at one task and do it, then return instantly the task is compleat. There is an example in the IDE examples page called "blink without delay", this is the basis of the solution, but it requires a step up in your programming techniques (knowledge).
There have been many ways this has been explained on this forum.
Try looking at this answer
How to write non blocking code