1590s, "pledge as a forfeit to another who makes a similar pledge in return," originally in the argot of petty criminals, a word of unknown origin; see bet (n.), which appeared about the same time. Intransitive sense of "lay a wager" is from c. 1600. Used since mid-19c. in various American English slang assertions (bet your life, 1848; bet your boots, 1856; you bet "be assured," 1857, identified in Century Dictionary as "originally California slang").
<a href="https://www.etymonline.com/word/betting">Etymology of betting by etymonline</a>
Harper, D. (n.d.). Etymology of betting. Online Etymology Dictionary. Retrieved $(datetime), from https://www.etymonline.com/word/betting