It sounds like there may be a hardware issue with your PC. When you hit the table or put something on it, the vibrations may be causing a loose connection or a faulty component to malfunction. Given that your PC is around 10 years old, it's possible that some parts may be wearing out.
One thing you could try is opening up your PC and checking that all the components are securely seated in their sockets. You can also check for any obvious signs of damage or wear on the components.
If you're not comfortable opening up your PC, or if you're not able to find any obvious issues, it may be best to take it to a professional for diagnosis and repair. They will be able to use specialized tools and equipment to determine the root cause of the issue and provide a solution.
In terms of upgrading, it may be worth considering investing in a new PC if yours is 10 years old. The components in your PC may not be able to handle newer applications and software, and upgrading individual components may end up costing more than buying a new PC altogether.