The oxygen atom in phenol is sp3 hybridized. Two of the sp3 orbitals are involved in bonding to hydrogen or carbon, and the remaining two contain lone pair or non bonding electrons.
Hybridization of N in aniline (benzenamine) lies between sp3 and sp2. Lone pair of N can be delocalized into ring best if N is sp2 and lone pair is in a p orbital. Lone pair bound most strongly by N if pair is in an sp3 orbital of N, rather than p. Actual hybridization is a compromise that maximizes binding of lone pair.