A midfielder in soccer plays a crucial role in both attacking and defending. They are responsible for linking the defense and the attack, controlling the tempo of the game, distributing the ball to teammates, and providing support to both the defensive and offensive lines. Midfielders need to have good passing, tackling, and vision to be effective in their position.