Aquel or este
How do you know when to use aquel or este for "that"?
That is never "este". You should choose between "ese" or "aquel". It is up to you. The first degree of closeness is "este", then "ese" and then "aquel" but your opinion is relevant.
"Este gato vino de esa casa que está bajo aquella montaña." (This cat came from that house that it is beneath? that mountain). Another speaker could use esa or aquella in both instances of that.
I speak a variety of Spanish that has just "este" and "ese".
This cat came from that house which is below yonder mountain.
(yonder is a bit old-fashioned. You might read it in books, but nowadays people generally say "that" for both ese and aquel.)
este (this)→ when something/someone is close the speaker (close or faraway the listener)
aquel/ aquello/aquella (that)→ when something/ someone is faraway speaker and and listener.
¿Cuánto cuesta este zapato? (How much is this shoe?) →close me
Mira aquel arbol en el final de la calle (look at that tree at the end of the street) [faraway you and me]
aquel arbol → with masculine nouns
aquella automovil →with feminine nouns