As others have mentioned, "getting rid of", or "resolving" is tricky language. For Type 2, I like to use the terms "reversal" or "remission". There are things you can do that may get you back to well regulated sugars, and prevent complications. There's nothing you can do to get rid of it that will allow you to go back to eating and doing whatever you want without risking your diabetes coming back.
That said, if reversal or remission is the goal, there's 3 main techniques that seem to have the most support.. One is ultra-low calorie diet, the second is low-carb eating, and the last is intermittent fasting.
For the first, the idea is to eat very little for an extended period of time (500 - 800 calories per day for 6-10 weeks or so), which allows your body to reverse some of the insulin resistance that has built up, and after that, eat sensibly going forward. I'm very much over-simplifying it. This approach is pretty difficult to stick to, especially doing it on your own (as opposed to under medical supervision). If this interests you, look for the work of Dr Roy Taylor on the "Newcastle protocol".
The second, simply involves eating less carbs. How much less depends on your situation. If you are newly diagnosed, and borderline, maybe only a modest change is required. If you're a decade in, and have more advanced presentation, then maybe going full-on keto is the way forward. FWIW, I think it's better to overshoot here. People who do the minimum will often find that it works for a while and then sugars start creeping up again. I interpret that as meaning that the minimum is enough to hold off progression of symptoms, but not enough to reverse the underlying condition. Your mileage may vary. There are tons of great sources of information on low-carb and keto, but I personally prefer YouTube videos featuring Dr Stephen Phinney.
The third involves just not eating for periods of time to allow your body to recover from the content flow of glucose in your blood. This can be as little as just not eating after supper until breakfast the next day, or all the way up to skipping eating for one or multiple days. If this interests you, then I would suggest checking out the work of Dr Jason Fung.
What these three methods have in common is that they all allow not only your blood sugar to fall into normal range, but your insulin levels are also allowed to fall as well. The evidence suggests that chronically and consistently elevated insulin is the core mechanism behind type 2.
I personally use both intermittent fasting and low-carb eating, and I think they work together very well, especially if you go full-keto on the low carb eating. When I am disciplined in both, I make clear measurable progress in reversing my type 2 diabetes. By that I mean my blood lab results stay in an excellent range, even as my Dr reduces the diabetes meds that I take.
Oh, last thing. There is no amount of sugar that is good for you ever. The only question is how bad. If possible you should find ways to live with as little sugar in your life as possible, and none ideally.
Good luck. Let us know how it goes.