|Mainly there are three ways MySQL CPU usage becomes problematic ...
1 You have a table in memory that needs an index for what you are asking of it, so you're doing full table scans in memory. Fix that with a covering index.
3 Code in stored procedures, stored functions, stacked views. You'll need to re-jigger that approach.
More general things to check ...
CPU usage spikes, or is continuously high?
What does top say? An i/o bottleneck will show higher cpu%; high mem usage will leave free mem low.
Check thread configuration starting with ...
show variables like '%threads%';
If global status var ratios ...
Select_range_check / Uptime_since_flush_status Select_scan / Uptime_since_flush_status... > 0, optimise those queries.
Suss out abusive processes and remove them.
Useful links ...
Last updated 16 Mar 2021