how to shutdown RPI4 when connected remotely?

simply run command:

sudo halt -p

You may also like...