Maintenace

HI, I am trying to keep my Mabox as clean and light as possible.
I have already made a lot of mistakes by deleting/removing things I shouldn’t have.
Is it wise to clear the pacman cache and yay cache items?
What is the right way to do it if necessary?
I appreciate your answers.
Mabox_20230716-20-16-36