Hello @rony765
I suggest you start with my tutorial Using Nextion displays with Arduino
However, if you have already written code you will probably have to start again to use my methods. From your brief description I don't really know what you are trying to do.
If you get stuck with my methods I'll help. If you are doing your own thing I might not be able to help much.