It's a common question that people ask to generate discussion, especially in the modern technological era. Do we live in a simulation? Is everything around us actually real? It sounds like a fun thought experiment about how the universe we live in came to be and whether it is as substantial as we perceive it. However, people are usually asking the question under a false premise: that the nature of reality gives it its significance.
The question behind the question is whether anything in the world matters (note the fitting word "matter", which means both substance in reality and substantiality in people's minds). And the assumption that is being made is that something being "real" makes it more significant. Therefore, if our universe turned out not to be real, as if we were existing in a computer program, it somehow would lose its significance.
The truth is that your perception is what gives things their significance. In other words, things in this world matter because you care about them. You care about whether you live or die, follow the rules or go to jail, or fit in or stand out socially. After all, our DNA programmed us to care about our own survival and be social to maximize our likelihood of survival, which is why life has meaning to us. That is what gives life meaning, not whether the universe we live in is a simulation or not. All the realization of how this life was formed or how it works would do it give you new information that would change your behavior to optimize your life against your desired outcomes.
For example, if this were a simulation and you could somehow escape it, you might do that. If you could bring some of what you know out of the simulation, you might accumulate resources or knowledge and take that with you. So, it might change your goals or behaviors, but its significance would be changed based on how you perceive that new information. It's why Neo in The Matrix took the red pill, wanting to live in the real world (no matter what it was), and Cypher wanted to get plugged back into the Matrix and eat steak, be an actor, and accumulate a decent amount of wealth. The new information led to a choice about how to live, but the significance of the Matrix reality vs. the Zion reality only changed based on how the characters perceived the two worlds. Neo placed significance on the Zion world; Cypher placed greater significance on the Matrix world for how much better his life was in it.
There is one final element to the question, however: the idea of free will vs. determinism is the other factor behind this thought exercise. The other part of "Does anything in this world/anything we do in this world really matter?" is whether we can actually change our circumstances for the better through our own conscious choice. This has the same logic behind the simulation question: "If this world isn't real, then it's possible that someone or something has programmed it, meaning my choices are not my own and everything I do is predetermined."
The confusion behind this is caused by the fact that your core capabilities are heavily influenced by your genetics, predisposing you to certain tendencies and giving you limitations. For example, you can't flap your arms and fly, and you might be programmed genetically to like broccoli but hate green beans. Yes, you have genetics that dictate many things. However, you also have a brain with advanced reasoning and decision making, giving you the ability to decide on things within the capabilities you have. Is it true that some people have poor impulse control and might be prone to addiction or violence, possibly leading to prison or death? Absolutely. But you also have the freedom to choose given the capabilities you have. For example, you can choose to stand or sit, to walk or run, to build houses or write novels. As long as you have the capability to do so, you can choose to do anything within those capabilities.
If you wonder whether this is true, then go to a store and pick up an item. With it in your hand, you have many options. You can go to the register and buy it. You can put it back and walk out of the store without it. You can try to walk about without paying. You can throw it through a window to damage the store. You can throw it on the ground and break it. You can consume it right there. You can play with it and then set it back down. Those are all options available to you. Your choice, then, is yours to make. Yes, they are influenced by your beliefs/ethics, by the laws against theft and vandalism, and other factors, but you ultimately decide what to do with yourself in that moment. That is the free will that you have. So, does it matter whether you're in a simulation and have that choice or not? No, because you will feel the pain of prison regardless of whether that prison is a physical place or 1s and 0s. And it doesn't matter that there are influencing factors in your decision as long as you have control over your actions and can ultimately decide whether to let those factors influence you or not. There are plenty of people who don't let the law stop them from acting the way that they want to, and there are plenty of people who don't let their primal instincts override their reason regarding proper behavior in society. It's ultimately your choice, and it matters to your life.
So, the next time you ask yourself about whether reality is real, remember to separate out the literal question of whether this is a physical universe or a computer program from the underlying questions of whether it would have significance if it were a program or it has control over you in that scenario. Because those are different questions. Your life is yours to determine regardless of whether this universe is "real" or not, and it matters to you because you choose for it to regardless of the nature of reality. So, whatever exists beyond this physical universe, the world you live in matters because you believe it does, and your actions have consequences within it. That you can be sure of no matter what we find out about existence.