This question is a tautology - of course you would write the written character and not the printed character!
The written characters and printed characters nowadays are both typeface/font variations of Regular Script (楷書), originally a style written using a calligraphy brush, and which is what that stroke diagram shows:
Regular script font imitating a calligraphy brush
The written character is now written using a pen, but still largely follows the stroke order of the original calligraphy styles, so it mainly just appears thinner than calligraphy-based fonts, and should look like the following:
Japanese textbook font (教科書體, きょうかしょたい), designed specifically to imitate pen handwriting in regular script.
The printed character in your example originated in the 1100's CE Song dynasty, when movable type was first invented, and is called Song or Ming typeface (宋體/明體):
Characteristics of this typeface are:
- Thick vertical strokes and thin horizontal strokes
- Triangles at the end of single horizontal strokes
- Geometrical regularity
It is the emphasis of Song/Ming typeface on geometrical balance that makes it divergent from natural handwriting, and there are deliberately introduced strokes in Song/Ming typeface characters that don't actually exist in regular handwriting.
The correct form of the character always defers to a calligraphy brush or pen based font, but there are also regional variations in what is considered 'correct'; that is, China, Hong Kong, Taiwan, Korea, and Japan all have different ways of writing Chinese characters, so you need to be clear as to what standard you're following and follow that closely.