c. 1200, short for away (adv.). Many expressions involving this are modern and American English colloquial, such as way-out "far off;" way back "a long time ago" (1887); way off "quite wrong" (1892). Any or all of these might have led to the slang adverbial meaning "very, extremely," attested by 1984 (as in way cool).
adverbial suffix expressing direction, Old English -weard "toward," literally "turned toward," sometimes -weardes, with genitive singular ending of neuter adjectives, from Proto-Germanic *werda- (cognates: Old Saxon, Old Frisian -ward, Old Norse -verðr), variant of PIE *werto- "to turn, wind," from root *wer- (2) "to turn, bend." The original notion is of "turned toward."
Others are reading
<a href="https://www.etymonline.com/word/wayward">Etymology of wayward by etymonline</a>
Harper, D. (n.d.). Etymology of wayward. Online Etymology Dictionary. Retrieved $(datetime), from https://www.etymonline.com/word/wayward