Well, this is where my dotted "i" and crossed "t" come into view. (I do wish we had access to the Hebrew copy of the book of Matthew.)
I know that there are many who have difficulty with the call "to be perfect." For many, it means something other than what the context of the passage shows us. I think that is where some get trapped in the legalistic understanding and suffer the stress of comparing our freedom in Christ with His statement to be "perfect." Indeed, I would like to be perfect like the Son of God. But, in this context, it is an instruction to love.
Mt 5:38–48 “You have heard that it was said, ‘An eye for an eye and a tooth for a tooth.’ But I say to you, Do not resist the one who is evil. But if anyone slaps you on the right cheek, turn to him the other also. And if anyone would sue you and take your tunic, let him have your cloak as well. And if anyone forces you to go one mile, go with him two miles. Give to the one who begs from you, and do not refuse the one who would borrow from you.
“You have heard that it was said, ‘You shall love your neighbor and hate your enemy.’ But I say to you, Love your enemies and pray for those who persecute you, so that you may be sons of your Father who is in heaven. For he makes his sun rise on the evil and on the good, and sends rain on the just and on the unjust. For if you love those who love you, what reward do you have? Do not even the tax collectors do the same? And if you greet only your brothers, what more are you doing than others? Do not even the Gentiles do the same? You therefore must be perfect, as your heavenly Father is perfect.
This set of verses comes from the Sermon on the Mount. We get wrapped around the proverbial axle because of the translator's choice of the English word "perfect." The Greek word used "teleios" is used to describe something that has reached its end or purpose, signifying completeness or maturity. It often refers to spiritual maturity or moral perfection, indicating a state of being fully developed in character and faith.
To me, we are being told to love those who don't love us. We must do that so that we are like our Father in heaven who loves those who do not love Him.