A monitor debug / analyzer for processes that consume memory and cpu causing system freezing and blocking

I would like a monitor that keeps track of processes that consume memory and cpu inappropriately.

Very often it happens that these two factors lead to the blocking and forced restart of the system for various reasons.

It would be advisable to try to understand which processes cause this problem, a tool that is able to analyze and identify the specific process that is the cause of the system overload.