OK, so I'm a player who likes having tactics beaten in to the party.
I frequently beg for this kind of treatment.
One of the best I can recall was something very simple: the party was walking through a dark area using torches.
The enemy stood in the dark area beyond our torch radius and fired ranged things at us.
They could see us, we couldn't see them.
Simple.
Lethal.
We learned.
Another case--same GM--we walked in to an area and got in to combat with the obvious group of combatants. When we were thoroughly committed to dealing with them, their second wing stepped out from behind a wall and pummeled our unprotected backsides.
They were not magically cloaked or anything--just standing behind a wall that had an open archway in it. A small amount of scouting or scrying would have revealed them to us, but we didn't think to do it.
For one character who had a weapon that magically returned to his hand after being thrown, he simply set a villian with a range: touch attack inside an antimagic shell. Come and get it, boy.
The GM I'm thinking of was a fine chess player. He used a lot of that kind of thinking in setting up the encounters. An obvious attack to lead you in to a position where the unobvious attack would come from, or where you'd practically nuked yourself and there really was no one else to blame.
And when we walked in to obvious, simple traps, he was nearly merciless. We were badly humiliated over and over until we learned. It was apparent that we were missing obvious, easy things that we really could have anticipated if we'd been paying attention.
Getting nearly killed is one thing--almost anything can be healed-- having the enemy loot (or tattoo, or shave, or plant eggs in) your bodies while you are unconcious--that hurts.
Set yourself up a villian who likes to gloat. The bad movie villian kind who wants to set the party into an escapable death trap instead of killing them outright, or who has a reason to take their stuff without killing them.
Or a cat burglar who lives for the thrill of sneaking into an unprotected camp at night and making off with stuff, but who is CG and won't kill helpless foes.
Or a band of tricksters -fairies, brownies, quicklings, leprechauns . . . something that is enjoyng thier humiliation more than their deaths. A band of illusion-using sprites who know how to trip up a party by adding extra steps to the end of a staircase will put ideas in their heads, all right. Slapstick is very educational--everybody loves mocking somebody with egg on his face--and no permanent damage is done.
Ooh--Set them up as the "victims" in bet by two competing teams of tricksters--the team that counts coup on them more times, wins the trophy. This can happen completely incidentally to your regular campaign--the PCs don't know why these little bastards are out to get them, but the jokes might be occasionally ill timed. Lose a night's sleep when you really really need to get your spells back, and your paranoia level should skyrocket. Or wind up with donkey ears just before you need to do a good roleplaying scene with a romantically inclined lady or irate employer.
Just make sure the pranks were things they had a reasonable chance to see coming, if they were paying attention.
Good responses to hazardous situations = treasure. Bad responses to tactical situation = poverty and embarassment.
Finally, the place to pull punches is not when the foe is attacking--the place to pull punches is when the party is starting to get the idea. Give them big success for attempts at teamwork, lots of praise, good, even specatacular outcomes. The PC who gives up a chance for personal glory to support someone else's attack, that PC deserves acknowledgement. Can be a treasure no one else can use. Perhaps the party has a magic item that responds well to . . .oh wait--I got it--I'll write it up next post.
They will learn.