This passage can be difficult to understand at first sight, and it is not helped by some rather clunky translations. Let us try and unpack what is going on.
Jesus condemns the Pharisees for being like a dish that is clean on the outside but dirty on the inside. That is, when you looked at Pharisees they appeared to be really righteous but in their hearts they were wicked.
We know that the Pharisees gave to the poor, but only to show off about how generous they were — they didn’t really care about the poor. Jesus says “give as alms those things that are within” (ESV) or “give what is inside the dish to the poor” (NIV). The Pharisees were giving money but they weren’t giving their hearts (i.e. they didn’t actually care about the poor). Jesus shows that this is the wrong way round — just like cleaning only the outside of a dish. Instead you need to start with the heart, with your motivation, and get that right. If what is on the inside (your heart) is pure then what is on the outside (your actions) will also be pure. And so “everything will be clean”.