In No-Limit Texas Hold'em, a side pot is an essential mechanism used to manage betting when one or more players have gone All-In but have less money than the other active players at the table. It ensures that no player can win money they did not contribute to.
A side pot is a secondary pot created to hold the excess bets made after a player (or players) has committed their entire stack (went All-In).
The Main Pot: The main pot contains all bets up to the amount contributed by the player with the smallest stack (effective stack) who is still involved in the hand.
The Side Pot: The side pot(s) contain all additional bets made by the remaining players after the All-In player's money has been matched. The All-In player is not eligible to win any chips in the side pot.
Side pots are created when an All-In situation occurs and there are still two or more players with chips remaining who wish to continue betting.
Player A goes All-In: Player A pushes their entire stack of, for example, 100 Chips into the pot.
Player B and Player C Call/Raise: Player B and Player C both have more than 100 Chips , say 500 Chips each.
Splitting the Chips:
The Main Pot is established, containing the 100 Chips contributed by Player A, plus a matched 100 Chips from Player B and 100 Chips from Player C (Total: 300 Chips).
The Side Pot is created using any bets above that 100 Chips.
Further Betting: If Player B bets 50 Chips in a subsequent street (Turn or River) and Player C calls the 50 Chips, those 100 Chips go directly into the side pot.
Multiple Side Pots: If Player C then goes All-In for their remaining 400 Chips (a total of 500 Chips) and Player B calls, a second side pot (or Side Pot 2) would be created for the amount Player C contributed beyond Player B's stack if Player B also went All-In for less than C. 
A new side pot is created every time a player goes All-In with less than the remaining active players.
Side pots are awarded based on the best hand among the players who are eligible to win them.
The Main Pot: The Main Pot is contested by all players who contributed to it. This includes all All-In players.
Side Pot 1: This pot is contested only by the players who contributed to it. Most importantly, this excludes the player(s) whose All-In triggered the creation of this specific side pot.
Tie/Split: If two or more eligible players have the identical winning hand, the pot they are contesting (Main or Side) is split equally among them.
Using the example from Section 2 (Player A All-In for 100 Chips, B and C have more):
Main Pot (300 Chips): Contested by A, B, and C. The best hand overall is Player A's Flush.
Winner: Player A wins the Main Pot.
Side Pot (100 Chips, from B and C's further betting): Contested only by B and C (Player A is not eligible). The best hand between B and C is Player C's Straight.
Winner: Player C wins the Side Pot.
Conclusion: Player A wins the main pot amount (300 Chips) because they had the best hand among all players for the Main Pot and Player C wins the Side Pot, the best hand among the eligible players (B and C) for the Side Pot.