How do you make a on and off switch for android?

I need ideas so anything would be helpful.

I also want to know pls anyone help.