The part of the grammar page this lesson drills — read it here, then use it.
Rule 3 - some consonant changes are written, some are not
When a voiced and a voiceless consonant meet at a morpheme boundary, Serbian spelling changes to match the pronunciation: под- (under) + -пис (writing) is written потпис (signature), with д devoiced to т in the spelling itself - the assimilation is written into the word, not merely pronounced.
On the other hand, Serbian does not mechanically devoice a consonant just because it sits at the end of a word. A word like друг (friend) keeps a normally voiced г in careful Serbian speech and always keeps it in writing - do not automatically turn final б/д/г/ж/з into п/т/к/ш/с out of habit.