Phase and sprint mean very different things
The waterfall process, as the name signifies, has sequential phases that flow from the previous one just like in a waterfall. This means that the next phase can start only after the previous phase has been completed. For example, you complete the Requirements phase, get sign-off from the stakeholders and then only can start the Design phase.
During a given 'phase' you only focus on that one thing and nothing else. So, for example, at the end of the Requirement and Design phases, the only deliverable is a document. No code will be delivered.
In contrast, one of the 12 principles behind the Agile Manifesto is:
Our highest priority is to satisfy the customer through early and
continuous delivery of valuable software.
In order to accomplish this, Agile tries to combine all the waterfall phases (Requirement, Design, Development, Testing and Deployment) into a short time box called a sprint (also called an iteration). At the end of this sprint a potentially shippable increment of code should be ready. Meaning it must be ready, tested and ready to be deployed. Some people do not actually deploy to production at the end of each sprint. However, it should be potentially deployable at the end of each sprint.
In waterfall methodology they use the term phase and in agile they use
the sprint term so is there a difference or they are only terms used
in each methodology.
Yes, they mean different things. Yes, these are terms used in each methodology.