Hi anirudh225,
It sounds like you're not able to start Apple Diagnostics on your M1 Mac. We're glad you've joined us in Apple Support Communities. Let's see if this helps.
The steps for starting Apple Diagnostics have changed for M1 computers, be sure you're following the exact steps in "Start Apple Diagnostics - Apple silicon" and not the steps for "Intel processor" in Use Apple Diagnostics to test your Mac.
If the issue remains after following those steps, let us know if you have all external devices disconnected, except for a connection to AC power as outlined in the section "Prepare your Mac" in the resource linked above.
We hope that helps with your question and take care!