The reaction of thionyl chloride with alcohol in presence / absence of pyridine is called as Darzen's reaction.
Here, the pyridine molecule acts as a catalyst which is used to neutralize the HCl -produced in the reaction.
CH3CH2OH + SOCl2 --(pyridine)-→ CH3CH2Cl + SO2 ↑+ HCl ↑
Here, pyridine acts as neucleophiles because, in the reaction a proton is added to the alcoholic oxygen due to the strong electronegative SOCl2 group,and this proton is removed by the pyridine and reforms the S=O and also the Cl- ion is removed from SOCl2 .
This Cl- ion reacts with electrophilic carbon of alcohol and displaces SO2 and releases another Cl- ion which makes the alkyl chloride.