Every action you take at the table must have a reason behind it.
Why do you bet or raise? Fundamentally, there are three possible reasons:
1. You wish to build the pot.
2. You wish to thin the field.
3. You must charge for a potential draw.
4. You are stealing.
Sometimes, a single bet can manifest more than one.
You have AKo and are in position with 3 callers and the flop comes AK4 rainbow. It is checked around. Why do you bet here? Your two pair is only beaten by aces, kings or fours. If you have continuation bet most flops, you are likely to be called by any ace or any big king and perhaps raised by A4 or K4. Your hand has only 4 outs to improve from here, and the only draw is an inside straight draw, so for the most part you are building the pot with what is very likely going to be the winner.
You have 94d in the big blind and there are 4 limpers (but the SB folded) with no raise. The flop comes 27Jd. Why do you bet here? The answer is squarely number 3. Yes, you have a flush, and it's likely going to be the best hand.... unless someone else has the ace or king of diamonds and draws a fourth diamond on the board. You must force those hands to pay a heavy price for that draw. If you are already overflushed, your opponent will surely raise your bet (unless they have Ax of diamonds and thus already have the nuts) for the exact same reason.
You have 5s7h in the cut-off and it's folded around. You raise. Why? Duh, number 4. The BB calls and the flop comes Jc 8c 2h and the BB checks. You bet, again because you're stealing, but what will it look like to your opponent? It will likely look like number 3, since there are two clubs out there. At worst, he would put you on AJ or if you're particularly loose A8. If he has a club draw, will he stick with it if you bet the pot (giving him only 2:1 pot odds)? Would he continue at all with AK? Surely he will raise with an overpair and at least call with a jack, allowing you to shut down on the turn and river.
You have JTh on the button and the flop comes 89Qh. Once you pick your jaw up off the floor, you notice that it's bet and called around to you. You flat call. The turn is the ace of spades. The post-flop bettor bets again. This time you raise. Obviously you're building the pot, but why raise on the turn when an ace comes? Because you want to represent a poorer hand than you have. You want them to think that perhaps you called on the flop with the ace of clubs offsuit and that the ace hit you, or perhaps that you're trying to bluff an ace. If you don't get a caller, then it not as big a loss as it sounds, since it means you're unlikely to have gotten any action later in the hand. If you do get called, then it can set up a large bet on the river that is not going to look nearly so much like you were slow-playing a monster. Besides, it means that the river bet can be larger for being the same fraction of the pot. Which means a larger reward for being hit by lightening. If the post-flop bettor has a flush, then you'll surely get action and will have a good chance of doubling through (or busting) him. If he was bluffing with crap, then you probably weren't going to get anymore money from him anyway.