How to close the whole browser and open a new browser?

i want to close the firfox whole browser, and then open a new browser again.
I assumed it could be done with xtype.
Such as xtype ${KEY_WIN+KEY_W}$ → for close, xtype ${KEY_WIN+KEY_N}$ → for open
but it doesn’t work.
Failed to XType ‘${KEY_WIN+KEY_W}$’

Do you want to work from a script like Powershell or Python? In this case you can use the command line RPA API