When you have a dispute with Y, say you want to claim damages from Y, e.g. money that you deem Y is liable to you and Y does not want to pay you; you do not usually sue Y. You will possibly try to amicably asking Y to repay you unless Y deems that he is not liable to you and is adamant about it.
In this case, you will seek redress from Y through legal action. Let's say you deem that Y is negligence towards you and cause you to suffer damage, then you take a cause of action (sue) against Y for negligence. Since Y denies liability as aforesaid, meaning, Y wants to defend himself and willing to 'fight' you in court. If not, he will just negotiate with you for a settlement and no court proceeding ensues. But Y wants to defend himself now. We will discuss the following general defences available to Y.
2.4 General Defences in Tort - Intro
2.4.1 Consent
2.4.2 Contributory Negligence
2.4.3 Illegality (ex turpi causa)