Question about betting on horses and odds of winning

I understand that if a horse is listed as a 20 to 1 shot to win, that if you put down $1 on the horse to win and it does, that you win $20.

But I’ve seen Triple Crown races where the “favorite” was listed as a 2 to 3 shot to win.

How does the betting/winning work out in cases like that?

You always start by getting back your wager, and then you get the odds as profit. So, for “2 to 3” odds, if you bet $3 (and win) you’d get the $3 back plus $2 profit for a total of $5.

Another, more likely, example: If you bet $2 on a 3 to 1 odds horse, and it wins, you get your $2 plus 3X$2=$6 for a grand total of $8.

Last example: If you bet 10$ on a 3 to 5 odds horse, and it wins, you get your $10 back plus $3 for every $5 you bet (total 2X$3=$6) for a grand total of $16.