Here "you" includes their ancestors that were slaves for many years. Alternate translation: "remember that your people were once slaves" (See: [[rc://en/ta/man/translate/figs-you]])
Yahweh rescuing the people of Israel from being slaves in Egypt is spoken of as if Yahweh paid money to redeem his people from slavery. (See: [[rc://en/ta/man/translate/figs-metaphor]])