Yes and no, the following entries are from etymonline.com (emphasis mine):
late 14c., "a result," from Old French efet (13c., Modern French effet) "result, execution, completion, ending," from Latin effectus
"accomplishment, performance," from past participle stem of efficere
"work out, accomplish," from ex- "out" (see ex-) + facere "to do" (see
Meaning "impression produced on the beholder" is from 1736. Sense in stage effect, sound effect, etc. first recorded 1881. The verb is
from 1580s. Related: Effecting; effection.
1827, from Latin efferentem (nominative efferens), present participle of effere "to carry out or away, bring forth," from ef- (see ex-) + ferre "to bear, carry" (see infer).
word-forming element, in English meaning mainly "out of, from," but also "upwards, completely, deprive of, without," and "former;" from Latin ex "out of, from within," from PIE *eghs "out" (cf. Gaulish ex-, Old Irish ess-, Old Church Slavonic izu, Russian iz). In some cases also from Greek cognate ex, ek. PIE *eghs had comparative form *eks-tero and superlative *eks-t(e)r-emo-.
So, in the case of effect and efferent, they share the prefix ef-, derived from ex- but they come from different verbs, the former derives from facere while the latter from ferre.
As for affect and afferent etymonline.com only lists affect:
late 14c., "mental state," from Latin noun use of affectus "furnished, supplied, endowed," figuratively "disposed, constituted, inclined," past participle of afficere "to do; treat, use, manage, handle; act on; have influence on, do something to," a verb of broad meaning, from ad- "to" (see ad-) + facere (past participle factus) "do" (see factitious). Perhaps obsolete except in psychology. Related: Affects.
According to wictionary, afferent derives:
From Latin adferens (“bringing to”), present participle of adferre (“to bring to”), from ad (“to, toward”) + ferre (“to carry, bear”).
So, afferent and efferent have a common origin and so do effect and affect. However, the ef- and af- pairs only share a common prefix. Still, since that prefix is the same for each pair, you can indeed use effect and affect to help you remember.