Intention To Treat analysis (ITT) is based on the principle "once randomised, always analysed". At a fundamental level, regardless of what happens after randomization (non adherence, withdrawl etc.), the subject would be kept in the final analysis. There is a multitude of ways in which this can be done. The following article could be of help.
Essentially, two main approaches to analysis can be applied in an RCT: the 'intention to treat' analysis and the 'as treated' analysis.
In an intention to treat analysis, treatment allocation at randomisation forms the final basis for establishing an exposure, regardless of any changes in the treatment arms after the randomisation. Hence, a subject allocated to receive treatment X will be assumed to have received the treatment. A possible weakness of this approach is the likelihood of exposure miss-classification bias / measurement bias.