All coaches are faced with defending screening action, mostly ballscreens but also screens away from the ball. While there are different ways to defend different screens in different situations, it is useful to start with one approach that can be used in virtually any situation.
Switching screens is one example, but it takes away any favourable match-ups that you wanted to have (although automatic switching is effective late in a shot clock).
Another approach is called "gapping", the defender of the screener ("xscreener") leaves a gap for their teammate to go between the screen and xscreener in recovering to the attacker using the screen.
1) Ballscreen (pick and roll)
When attacker 4 screens for ballhandler 1, X4 (defender of the screener) leaves a gap for X1 to slide through and recover to 1.
Here gapping is used to defend a pick and roll on the side.
X1 should force 1 to use the screen.
2) Screens away from the ball
1 downscreens for 4, X1 leaves a gap for X4, who slips the screen through the gap.
X4 goes ballside of the screen, between the screen and the ball.
At higher levels of play, offences have counters when gapping is used, X4 could instead just chase cutter 4.
4 backscreens for 1, X4 leaves a gap for X1.
4 flarescreens for 1 (with his back towards the corner), X4 gaps for X1.
5 cross-screens for 4, X5 hedges the cutter low with his butt to the baseline and leaves a gap for X4, who goes over the screen (seeing the ball) then recovers if 4 goes under the screen. X4 can't let 4 flash high for a pass.
Option - X5 hedges low but stays close to screener 5 (like a squeeze), X4 goes over 5 and X5 in recovering to 4.
If defenders are switching, X5 would also hedge low and X4 go over 5.
5 flex screens for 3, X3 wants to go ballside (unless the screen is high on the lane line, then go under), so he jumps to the ball and sits on top of the screen, seeing the ball, X5 hedges low, X3 recovers over 5 and X5 (see Cross-screen above).
1 sets a flex downscreen for 5, X1 leaves a gap (he jumped to the ball on the pass to coach).
X5 can switch (bump) if he is pinned, he calls it.