This verse demands a little bit of thought because on the surface we seem to get some contradictory instructions. Consider this from the Law,
(Exodus 22:26 KJV) If thou at all take thy neighbour's raiment to pledge, thou shalt deliver it unto him by that the sun goeth down:In Exodus we are to return what was taken as security for a loan. In Proverbs it is to be kept. Maybe you see no problem here and that is because you understand two differences.
First, it is the person guaranteeing the loan that is fair game. As bad as it is to borrow, it is also bad to loan. We can sell at an honest price. We can give to those in need. Borrowing opens all kinds of doors to greed and exploitation.
Second is the difference between “neighbor” (7453) and “stranger” (2114a). I believe that in the Old Testament the neighbor is one of the spiritual family of Israel and the stranger is not. In the New Testament the terms are “brother” and “neighbor” with the same breakdown. There is a difference in how we treat people who are a part of the communion and those outside. There is also a priority in the way we give of our resources to what has become charity. We should not give to every charity that comes to the door even if they are worthy. We only have so much to give and we are to take care of our immediate family first, then our spiritual family and only then do we give to the world at large.
So? Be generous but don’t lose sight of priorities and principles.