Diving is a safe sport if you’re being careful. Scuba Divers that are participating in the sport with ego could get themselves into trouble.
Know your limits, don’t run before you can walk or in this case don’t deep dive before… well before you are comfortable and have been certified to do so.
Also something I’d like to point out is that your limits aren’t just physical, they are mental. If you get into a position or a dive location you haven’t been before, things can soon change. Don’t fear, but do be mindful of this and remain in your capabilities.
If you wish to go deeper or to a trickier dive site, then first dive consistently and get the years of experience. Make sure that you do not exceed the maximum depth that you are meant to dive.
Ensure you are fit enough, if the area is too testing then maybe you give that site a miss. If you are under the weather then postpone your scuba diving trip until you’re better.