With 'er' 'or' 'ist' suffixes you are usually dealing with an agent noun
From the Wikipedia link:
In linguistics, an agent noun (in Latin, nomen agentis) is a word that
is derived from another word denoting an action, and that identifies
an entity that does that action. For example, "driver" is an agent
noun formed from the verb "drive".
So with agent nouns the verb comes first and the noun arises later. But in your example it's actually the other way round. The verb guard is derived from the noun. (Alternatively it was derived separately from the old French, but later chronologically, which would still explain why it doesn't fit the standard pattern.)
From the online etymology dictionary
early 15c., "one who keeps watch, a body of soldiers," also "care,
custody, guardianship," and the name of a part of a piece of armor,
from Middle French garde "guardian, warden, keeper; watching, keeping,
custody," from Old French garder "to keep, maintain, preserve,
protect" (see guard (v.)).
mid-15c., from guard (n.) or from Old French garder "to keep watch over, guard, protect, maintain, preserve" (corresponding to Old North
French warder, see gu-), from Frankish *wardon, from Proto-Germanic
*wardon "to guard" (from PIE root *wer- (3) "perceive, watch out for"). Italian guardare, Spanish guardar also are from Germanic.
Related: Guarded; guarding.
Such a conversion process is seen by some linguists as a form of metonymy.
There's a very detailed article here from which I'll also lift their definition:
is a cognitive process in which one conceptual entity" the vehicle"
provides mental access to another conceptual entity" the target"
within the same idealized cognitive models (Radden and Kovecses 1999,
In your case the noun denoting the agent of the action -- the guard -- is employed to denote the action itself. So 'guard' comes to mean what a guard does. A parallel example (from the above linked article) would be the noun father becoming the verb father as in 'he fathers several children'.