Betting is the act of putting more chips into the pot that your opponents must either call by putting in their own chips or fold by discarding their hand. Some bets are blind (such as blinds in Hold'Em or antes in Stud), some bets are set in size (as in Limit games) and others can be as much as you have in front of you (as in No Limit games). But betting is the essence of poker: you bet that you have the best hand, and your opponent either puts up chips of their own or gets out of there.
When you bet, you're doing so for one of two reasons: either to build the pot by making your opponent call, or to win the pot by forcing an opponent to fold. Either way, the point is to win the pot! So you should always bet when you believe it increases your chances of winning, as well as the number of chips you'll win.
How you bet varies depending on the game you're playing.
In all cases, you can state "bet" and then put chips in the pot. But remember, verbal actions are binding, so if you state the amount you bet, that's how much your opponents are obligated to call. And at the other end, if you say "bet" and then place chips in the pot without citing the amount, be careful: if you accidentally slipped your $100 chip at the bottom of a stack of $1s, your bet is binding!
Betting in poker is about giving misinformation to your opponent: you want to bet in a way that makes them think how you want them to think. So, if you want your opponent to be afraid, you need to bet just enough for them to think you have the best hand--but not so much that they think you're bluffing. If you want your opponent to call, you want to bet enough to lure them in--but not so little that they think you're stringing them along. Every player, table, and hand is different, so learning how much to bet and when is one of the hardest, most nuanced parts of the game.