How to write code for toggle

i have a toggle button with on and off but in the code i can see before::after
am not aware how to write xpath for this
and based on the toggle ON and Off i need to click on it
KIndly let me know how can i proceed
If i use CSS selector i can see this
body > div:nth-child(11) > div.modal-body > form > div:nth-child(1) > div > div > label > div.onoffswitch-inner

but not knowing exactly its ON/OFF how to know it

Hey Shiva @ShivaRaju, maybe try checking the solution from the previous post here about handling the toggle button.