The same thing started happening to me in my mid to late 50s. Somehow one of my legs would just give out without warning and I'd go down like a felled tree.
I was lucky that I didn't break my nose falling onto my face, and it was so embarrassing to have to get up afterwards, especially if people had gathered round. It got to a point where I was reluctant to walk anywhere, and when I did I had to concentrate on what my legs were doing, ready to get my hands out to catch myself if one of them gave out.
I had a pair of Nordic walking poles, and remembered chatting several decades ago with another woman I'd often see strolling through the forest, both of us using walking poles. She confided that she needed them because she had survived a traumatic brain injury that had effected her ability to walk (you couldn't tell she walked a lot quicker than me), and she felt much sportier using walking poles compared to any of the aids the health system could offer.
So I started using my poles, both of them if I'm walking any distance, but for shorter distances, and when using public transport just one is enough. People did give me some funny looks when I walked through the city centre with a couple of walking poles, and every now and again some joker will ask if I've forgotten my skis, but I don't care anymore, at least I'm not constantly worrying about falling over (and face planting in a heap of dog turds.)
Every now and again a knee or ankle will give out, but so far the pole has caught me and kept me upright allowing me to regain my balance. They are very strong, but light weight, and have a wrist strap so, unlike a cane, you don't need to dedicate a hand to holding them and can leave them dangling from your wrist while you rummage in your bag or mess with your phone. They are telescopic, so if space is an issue you can shorten them into little batons.
ALDI and Lidl tend to sell them every now and again, or you can buy them online.