'in spite of' is a prepositional phrase that indicates contrast. It is used to introduce a statement that describes a situation or fact that might seem to contradict something previously written or spoken, but does not.
'in spite of' is used to introduce a contrasting element in a sentence. It is synonymous with 'despite' and can often be used interchangeably with it.
In spite of the rain, the parade continued.
She was cheerful in spite of all the challenges she faced.
In spite of his age, he can still run a marathon.
'in spite of' and 'despite' are often used interchangeably, but it's important not to mix their structures in a sentence. For example, it's incorrect to say 'In spite of he was tired, he finished the race.' Instead, it should be 'In spite of being tired, he finished the race.' Avoid using double negatives with 'in spite of.' For instance, avoid sentences like 'In spite of not having no money, he bought the car.' Instead, it should be 'In spite of having no money, he bought the car.' 'In spite of' is followed by a noun, pronoun, or gerund (the -ing form of a verb that functions as a noun).