A bad beat in poker is when you have a good hand that is most definite to win but is eventually beaten by another hand. Most of the time it is a hand that ends up catching a miracle draw on the river betting round that probably should not have been played at the pre-flop stage.
Examples of extreme bad beats would include pocket Kings beating pocket Aces with a third King on the river or a player hitting an inside straight on the river to beat a made hand. In both of these situations, the drawing hand would have, at maximum, 4 outs (cards to come to give a winning hand) and less than a 10% chance of winning, but still they end up on the winning.
Bad beats are a normal part of poker that a good poker player learns to accept. You might lose an occasional pot to a bad beat from these players but their bad play will lose to your good & solid play most of the time. In the long run you will make money from players who constantly chase the inside straights or baby flushes. In these types of games you will find that your bankroll fluctuations will be greater but your wins will be bigger.
Some players get shaken up and go on tilt when they suffer a bad beat. You can't let it affect your play. If you get upset after suffering a bad beat, get up and walk away from the table for a hand. If you are playing go to post and fold or quit and come back later. Cool down and then get back to your game. This will certainly do your confidence a whole lot of good.