Those aren't terrible temps.
Before we go any further, we're going to talk about case airflow, not coolers.
Airflow / Fan / Cooling / Overheating - How to test, steps to resolve
This could be caused by a few different things, please don't automatically assume 'the cooler is not working' without also checking if the case airflow is sufficient.
Remove the side panel of the PC case. Orient a house fan (desk or box style fan) to blow air into the case, directly over components at the highest setting.
This will represent a case with the best possible airflow possible. For reference, the fans I am providing as examples would look like the items below (just to clarify for anyone who might want reference)
Re-test as you have normally done - play games, run benchmarks, etc. to get to where temperatures were normally seen to be higher than they should. Normal room temperature is usually between 20-24C or 68-75F. Please note that every air or liquid cooler operates as a product of delta-T over ambient, meaning that if the PC is operational (simply turned on), it is impossible for the CPU to display a temperature below ambient room temperatures. If it is, this is likely a bug in software temperature reporting either from the desktop UI or the BIOS reading it incorrectly.
With the fan running at full speed, if temperatures drop by 5-7C or more, case airflow is one major issue to contend with. You will need additional fans or better fans for your setup in order to optimize air in and out of the chassis. This might even require consideration for a new PC case or leaving the side panel partially open during sessions of heavier computing until these items are corrected.
If your temperatures remain relatively the same (difference less than 1-2C), then you likely have an issue with the cooler in question (if CPU is hot, CPU cooler, if GPU is hot, GPU cooler). It would be good to then approach the next steps by thoroughly cleaning the cooler with compressed or canned air and ensuring there are not large blockages in cooling fins or on fans, etc. This might require the cooling fans to be removed from the heatsink or radiator to ensure there is not a buildup of pet hair, dust or even carpet fibers which can trap additional debris. Please ensure the PC is turned off and unplugged during this process to prevent unwanted startup to keep fingers safe from fan blades or accidental shorting if you happen to drop a screw onto other components during fan removal.
Removal of the cooler and re-application of thermal paste & re-seating the cooler can also be beneficial once cleaning of the cooler is ruled out by retesting the steps above.