Here's my DR history, over 1000+ races:
Around the time I started really taking the game seriously and playing it regularly (probably somewhere around the 100 days mark) I had a great race in Gr.4 cars at Interlagos. I was in a GT-R and fighting with a guy in a Megane Trophy. I spent the 4 or 5 laps going back and forth with him, eventually getting past him on the last corner to take the win.
I watched that replay back fairly recently and was appalled by two things. How slow I was and how much contact there was throughout the whole race. What I remembered as an intense, close and robust (but fair) race wasn't really that at all. What at the time felt like me having to drive at my best both in terms of pace and in response to someone else wasn't either of these things, or at least was a very clumsy attempt at it.
The only thing I or anyone else can really tell you is practice. The more you play the more you'll get used to how cars handle and how to drive them as close to their full potential as you can. The point I'm at in my GT Sport abilities is one where my consistency drives me insane. I might be able to do one lap that's within a second of the top guys, but that's one lap within a run of 20 others where I'm nowhere near. That's after 600+ hours of driving.
The more you practice, the more quickly you'll be able to take to different tracks and cars. The more quickly you'll feel comfortable and confident, and be able to put in relatively quick (or quicker than normal) laps. The main benefit of this in regard to your thread premise is that the faster you are, the less you'll have to contend with erratic or lower-skilled drivers online. Then as your DR goes up as your results improve you get matched against better, more consistent, more predictable drivers. By that point you've improved your own driving, so it becomes easier to learn how to control your car in relation to your competitors.
Ultimately you can't control what the people you race against are going to do. Some might be bad, some might make mistakes, some might be dirty. Or at least they won't try to be clean at all costs. As you're still trying to learn, focus on your own car control and placement. Watch videos on youtube from people like Super GT or Tidgney - you'll get advice from people much better at GT Sport than I am, and you'll be able to see them doing it at the same time.
If you want one piece of advice in response to your question, I'd have to give you two. Don't put yourself in dangerous positions, and focus on your own pace as much as possible. You can get better.