Commander is one of the many formats that Magic the Gathering can be played, and is by far one of the most popular formats. Commander allows players to make their own decks that are able to fit a specific playstyle. Some examples of playstyles could be bolstering your creatures on the battlefield, creating copies of your opponent's cards and using them against them, sacrificing cards to gain new abilities to turn the tide in your favor, the list goes on and on. This website can be used to build your own Commander deck and help you learn how a game of Commander can be played.
In order to play a game of Commander you are going to need a Commander deck. A Commander deck will consist of 99 cards plus 1 Commander card. Commander cards are creatures that are classified as Legendary creatures. When you are building your deck it is important to know what your Commander does and what their color identity is. The cards you choose to add into the deck need to match the colors of mana your Commander uses, and they need to synergize with what your Commander does. Say your Commander can give your creatures +1/+1 counters to increase their hitting power and health, you could pair that with cards that can do specific things when a creature gets a +1/+1 counter like creatures can now fly or have lifelink.
Now that you have a Commander deck ready to play with Let's go over how to play a game of Commander! At the start of the game, you and each player in your group starts shuffling their decks to randomize the cards they will get. It is recommended to ask another player in your group to "cut" or split your deck. This is to reduce the chance of cheating and promote fairness for the game. Once you and your opponents are finished shuffling your cards, everyone will grab 7 cards from the top of their library of cards. This is going to be the hand that you start the game with.