To calculate the optimal bet size based on card counting, you begin by tracking the running count, which assigns values to each card dealt (e.g., +1 for low cards, -1 for high cards). Once you have the running count, you convert it to a true count by dividing the running count by the number of decks remaining in the shoe. A higher true count indicates a favorable deck for the player, meaning more high cards remain, so you increase your bet size accordingly. Your base bet size, known as the betting unit, is typically wagered when the count is neutral. As the true count rises, you increase your bet, often by multiplying the base unit based on the count. Proper bankroll management is essential, ensuring you have enough funds to withstand losing streaks. Betting in this way maximizes wagers when the odds are in your favor while minimizing risk when the deck is less favorable.