The role of a defender in sports like soccer or basketball is primarily to prevent the opposing team from scoring. Defenders are responsible for marking their opponents, blocking shots, intercepting passes, and clearing the ball away from their own goal. They play a crucial role in the team's defense and are often the last line of defense before the goalkeeper. Defenders also provide support to the midfielders and forwards by initiating attacks and helping maintain possession of the ball.