There is nothing that goes waste
I remember using the first semblance of a smartphone in early 2000s. It used to be half display with the remaining half having a hard keypad. I was in Peru inside a telecom operators network lab that you can reach after crossing several layers of security carrying machine guns. I was trying to test a solution we built, end-to-end and had several smart phones (of those times) trying to use SIP (Session Initiation Protocol) which is a signaling protocol for establishing voice connections and transmitting voice over IP network.
I used to watch Olympics that was streamed live and never had an idea that the technologies I was so deeply working on will enable human race to handle a pandemic. Yes, fast forwarding to today, I can see every grandma using a computer in her hand watching videos with ease or chatting with their family when twenty years ago, every one around me was using a circuit switched voice only phone.
I never imagined at that time that just by flipping your thinking you can support humanity in an unprecedented way years later. Just the simple thought of eliminating the hard keypad that was occupying the display and making it a full touch based display one could bring a powerful computer accessible to the last person on this planet.
Nor I could even correlate how an invention of a gorilla glass in 1960 could come handy for the first smartphone as a scratch-resistant, hard, light-weight display surface.
You can keep connecting things to the beach sand that is used for producing it or the chemists who discovered SiO2 in that beach sand or the Computer Scientists who invented Unix and C language in the Bell Labs in 1970s that evolved to run the hardware of the smart phones.
All those tiny little things coming together saved your grandpa, your uncle and a million others from going and standing in the bank to withdraw cash or book tickets or buy food when the pandemic was raging.
Some of the things that we do today may not appear meaningful in our present life. Science always works late by thinking ahead. How everything comes together for a greater impact is not something anyone can imagine when you are doing those tiny meaningless things today.
It appears to me that whatever you do today beyond your basic needs is not going to be a waste. It is important you identify some thing that intersects your interest, skill and a problem that does not allow you to sleep and simply go forward working on it, without worrying about whether it will be useful or not, whether it will make you rich or not, whether others will like it or not, whether you will be remembered by the future history or not.
Whatever comfort we enjoy today is a by-product of the minds before us who went forward to sow the seeds without bothering if they will be there to eat the fruit. This is the greatest endeavor of being human.
Those brave hearts went beyond their present to build our present.