When to use Cancel button?
If the user asks for something but doesn't want it, then you can be sure that it's Back button time. Offer a Cancel button when users may fear that they have committed to something they want to avoid.
What does cancel button mean?
What does the Cancel button do exactly? It dismisses the user's current screen and brings them back to their previous screen. This dismissive button is a safeguard to prevent unwanted changes to the system.
Should cancel be a button or a link?
To summarize
The cancel option is similar to aborting an action, and therefore similar to navigating back to the previous state of the UI. Navigation is represented in web UI as hyperlinks, and thus the cancel option should be a hyperlink.