I wanted to add a perspective to this since this can be a contentious issue, and I would still say knowing whether a nitrogen is $sp^2$ or $sp^3$ hybridized is not straightforward. I was originally hoping to add this under this question specifically about aniline, but that question is now closed and marked as duplicate, with a link to this question.
In a simple molecule like aniline, one might think that the hydrogens of the amine would be planar with the ring. However, we know from crystal structures of aniline that it is indeed pyramidal. If you have access to the Cambridge Structural Database (CSD), you can see this in structure BAZGOY. The improper dihedral angle of the hydrogens is ~26 degrees in that structure.
I was also curious to see what QM had to say about this. I performed some optimizations of analine with the improper dihedral angle of the hydrogens constrained at various angles. Here is a drawing of the improper dihedral I constrained.
I used the MP2 method and cc-pVTZ(-F) basis set, in implicit solvent (PBF) using the Jaguar software from Schrodinger. You can see in this plot and gif that the lowest energy angle was at ~35 degrees. That's pretty much completely pyramidal (in ethane, an equivalent angle is 33.4).
However, that being said, I also wouldn't say this is dogmatic. This is an implicit solvent calculation, and in real water with real hydrogens and oxygens to hydrogen bond to, things may be still different. NMR might be able to help figure this out, or it could further confuse if the timescale of flipping smears the signal to give a flat angle when it is not.
I should also point out that there are other crystal structures that contradict this. If you look at the crystal structure VOMFOS, which is of an adenosine analog, the amine hydrogens are planar with the ring. Is that just an artifact of the crystallization packing network, or a true representation of the hybridization of that nitrogen? Hard to say.
I think my main point here is to be careful what you assume. If you asked me on a test in undergrad whether the amine on aniline is $sp^2$ or $sp^3$, I would have said $sp^2$ with confidence. Experimental and computational evidence suggests that might not be the case.