Sri Lanka, following on, were dismissed for 119 in their second innings as England went 1-0 up in the three-match series.
Anderson finished with match figures of 10 for 45.
Anderson ends Headingley 'hate' in style
England, who lost the toss, made 298 in a first innings featuring Jonathan Bairstow's 140 on his Yorkshire home ground and a Test-best 86 from opener Alex Hales.
Sri Lanka in reply were shot out for 91, with Anderson taking five for 16 and Stuart Broad four for 21 in an innings that was wrapped up inside 37 overs.
England will host day-night Test, says board chief
England captain Alastair Cook enforced the follow-on and Sri Lanka promptly collapsed again, with only Kusal Mendis (53) offering much resistance.
Sri Lanka, 116 for seven at tea on Saturday, lost their last three wickets in nine balls after the break, with Anderson ending the match when be bowled last man Nuwan Pradeep.
The series continues with the second Test at Chester-le-Street starting on Friday.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ