- You did not try hard enough.
- You have not been trying hard enough.
Are they correct both? Which one would you use in your everyday life situation?
Both are correct but their contexts are different.
Your first example:
You did not try hard enough
refers to a specific occasion. It might have been a test, an exam, a race or a competition.
Your second example:
You have not been trying hard enough
refers to the lack of effort that someone has been putting in over a period. The speaker might be talking about a year's study at school or university for example. Or just about a couple of weeks on a course.
The important bit is that the first example talks about something that happened at some point in the past, whether last week, last month or last year.
The second example refers to a period that began at a point in the past and continues until the present moment. So a teacher, parent or coach might say this half way through a term or course to urge the person concerned to try harder.