It is always worth checking first that the tax demand, whether it be in the form of an Accelerated Payment Notice, Discovery Assessment or Closure Notice, complies with the necessary time limits and other procedures in order to be valid.
But assuming that it does and it relates to a tax scheme that HMRC have defeated, whether in the tax tribunal or by legislation, then you are going to have to settle it.
It is at this point that you may also consider a claim against the adviser who sold you the scheme.