Not being able to concentrate and show interest when you are actually supposed like in your case you say you are in your 12 th, may just be performance anxiety( fear that may be aroused that one may not be able to perform as required). A clinical interview face to face would be useful to evaluate whether it’s depression, anxiety or something else. Please visit a mental health professional and get yourself evaluated.
Next Steps
Visit a mental health professional immediately