Put your computer in a well ventilated place, with some free room around your computer for heatsinks.
First, leave idle for 20 minutes. Observe temperatures. If it goes beyond 60C, it's definitely a cooling problem. If it's under 50C, it is all okay.
Then do a stress test for 20 minutes, for cpu and gpu separately. If any of them passes 90C, then there is a problem. Otherwise, it's all okay. Some computers even don't perform well in stress tests, even if they are brand new. So, you need to compare your stress test values to other users values to know if there is a problem.
For GPU Stress test, I recommend Furmark, I like it. But any tool is fine.
So after you did the tests, and if there is a problem, you can do these:
1 - Reapplying thermal paste.
2 - Cleaning heat sinks and fans.
And don't use your computer in dusty places, don't leave tobacco in the table etc.