I closed the lid on my 4yo Mac and stuck it in a drawyer 3months ago. I guarantee I could go open it and vscode and Firefox will be just how I left it after it wakes
The trick was to get 16GB in 2013.
The trash can might have a little more life left in it yet.