Paul uses this question to rebuke the Galatians for behaving as though their faith in Christ and their suffering for it were for nothing. Alternate translation: "You have suffered so many things: Do not let it be for nothing!" or "You suffered so many things from those who opposed your faith in Christ. If you now think that righteousness comes by obeying the law, then your suffering was for nothing!" (See: rc://en/ta/man/jit/figs-rquestion and rc://en/ta/man/jit/figs-explicit)
The Galatians had believed that God makes people righteous because they trust in Jesus Christ, not because they obey the law. Because of this, they suffered many things from those who opposed their faith in Christ.