The button determines which player at the table is the acting dealer. In Texas hold'em, the player on button, or last active player closest to the button, receives last action on all post-flop streets of play.
When playing in casinos or online, you won't have to worry about who the dealer is. When playing with friends, everyone usually takes a turn at dealing the cards. After each hand has been completed, the button rotates one position to the left. While staff dealers handle the duty of dealing out the cards in brick-and-mortar casinos, and the process is automated online, this isn't the case in home games. A small tip is to find the most skillful dealer in the game, offer him or her a beer or a small tip and have them deal the game while the button keeps track of which player is the "dealer."
While the dealer button often dictates who the first players are to begin the wagering with the small blind and big blind, it also determines where the dealing of the cards begin. The player to the immediate left of the dealer button in the small blind, receives the first card and then the dealer pitches cards around the table in a clockwise motion from player to player until each has received two starting cards.