They are blessed who realize their spiritual poverty, for the kingdom of heaven belongs to them. Matthew 5:3
They are blessed who are persecuted for doing good, for the kingdom of heaven belongs to them. Matthew 5:10
Jesus is teaching what kinds of people are blessed by God. The top verse starts the section. The bottom verse ends the section. See the same words?
Persecution means being punished or attacked for who you are or what you believe. Have you ever been punished or attacked for doing something right and good?
The Bible describes a fight between good and evil; between God’s ways and everything else. Sometimes when you do good things people thank you and praise you. But sometimes they fight you because they don’t like people doing good things. They don’t like God’s ways, so they will fight you.
So what happens when someone fights and hurts you because you did good? Don’t feel sad or bad. Understand that you are on God’s team, doing God’s work. God blesses you for doing that! Be happy for that.