From OE giernan (to desire), PGmc *gernijaną, PIE *gʰer- (to desire). The g→y palatalisation (as in yield, yell, yard) shifted the initial consonant. German gern (gladly) is its living cognate. Survived the Norman Conquest because no French word reaches the same depth of ache.
To have an intense feeling of longing or desire for something, especially something absent or difficult to attain — from Old English giernan, with the g→y palatalisation that defines the Anglo-Frisian branch.
The verb 'yearn' descends from Old English giernan, geornan, or gyrnan — variant spellings all meaning 'to desire, long for, be eager'. These derive from Proto-Germanic *gernijaną, a denominative verb built on *gernaz (eager, willing, desirous). The shift from Old English initial g- to Modern English y- is a diagnostic feature of Anglo-Frisian palatalisation: before front vowels, the Proto-Germanic velar /g/ softened to a palatal approximant /j/ in Old English and Old Frisian, the same change that converts gieldan into 'yield', giellan into 'yell', geard into 'yard', and geoc into 'yoke'. This palatalisation distinguishes the Anglo-Frisian branch from continental West
The y- in yearn is the same sound change that gave English yield, yell, yard, yoke, and young — all from Old English g- before a front vowel. The palate pulled the consonant forward and fixed it as y. Meanwhile, German kept the g: gern (gladly, with pleasure) is a direct cognate of yearn, still the everyday word for doing something willingly