I imagine someone with a lot of money could afford a place to keep that money, but if I'm a part of the working class and I want to save some money for a larger purchase, how would I go about doing that safely?
When and where do you have in mind? Postal savings accounts were one such method of savings for areas without banks: https://en.m.wikipedia.org/wiki/Postal_savings_system
But the answer for, say, medieval Scotland or ancient Carthage might be quite different.
We can expand your question: how did people without access to formal financial institutions save money? By making informal agreements with trusted people they know (family, close friends, etc.) These agreements could range from the simple - keep my money safe for a while, I’ll give you an additional dollar a week - to the complex - pooling of money through credit associations and allowing members to bid on the pool (which, coincidentally, allows us to derive interest rates). There are significant, somewhat obvious problems with such arrangements though - what if I’m not paid back? What if the credit association collapses? What happens if the person I’m saving with gets robbed, runs away with my money, doesn’t give it back, etc.?
You may interested in the book Portfolios of the Poor. It provides a more in depth study of how those with limited access to formal financial institutions save, borrow, insure against risk, etc.
Wealthy or poor, you could keep it in a locked chest/box located in your home or somewhere else safe, or you could simply bury it in a secret location in the middle of the night. Caches of coins found in archaeological digs are often examples of this kind of saving.
Samuel Pepys, who was not working class nor living before banks, buried a substantial sum in a 'secret' location in order to preserve it. He refers to his annoyance at the method his father used (digging in daylight) in this letter.