You will be perfect as your heavenly Father is perfect (Matt 5:48)
Now the first mistake people make with this verse is to forget that it's an indicative. Jesus could have used the imperative here (You must be perfect), but He chose to use the future indicative - You will be perfect.
The other mistake is a broader one about God's 'perfection'. Typically people think about divine perfection as that which excludes. You know the sort of thing - "God is perfect, you are not. You've got a snowflakes chance in hell with a perfect God, etc, etc."
And don't we just hate the idea of a 'perfect' person? Because what we have in mind is someone who can't stand faults. Perfection, to our way of thinking, is actually pretty unattractive. And instinctively we feel like perfection is the enemy of that which is broken, faulty, sinful. It just seems like perfection excludes.
But the context in Matthew and the parallel in Luke show a very different picture of perfection.
The Father's perfection, as Jesus explains it, is (Matthew 5:44) a love for enemies, (v45) sun and rain for the ungodly, (v46) love for the unlovely, (v47) welcome for the stranger.
And the parallel in Luke says:
Be merciful as your heavenly Father is merciful (Luke 6:36)
Divine perfection is not exclusive - it's inclusive. It is the Father's perfection to have mercy on rotten sinners. The perfection of God is not what keeps you out of His presence, the perfection of God is His heart's desire to constantly draw you in.
And when we get that through our thick skulls, then we'll start being like our merciful God.