Take the garment of one
who puts up security for a stranger;
hold it in pledge
if he does it for a wayward woman.
This verse is speaking about accountability and keeping your promises.
If someone puts up security for a stranger, they do not know how reliable that person is, but they still need to be held accountable. If someone puts up security for a wayward woman, they know that there is a lack of reliability there, but they still need to be held accountable for the security that they put up.
Even if the promise that has been made is one that shouldn't have been made, it should be kept.