Inability to pay attention at any task, no interest in any activity could be due to any reason. You need to share more about what you are experiencing.
Constant noise in your environment, frequent thought about something or stress could be the reason.
Kindly consult a Clinical Psychologist for a detailed evaluation.
Next Steps
Consult a Clinical Psychologist.