Press tofu between paper towels for 10 minutes to remove excess moisture, then cut into 3/4-inch cubes.
Toss tofu cubes with tapioca starch until evenly coated.
Heat avocado oil in a large pan or wok over medium-high heat.
Add tofu cubes and cook for 6-8 minutes, turning occasionally, until golden brown on all sides.
Add garlic, ginger, onion, and chili flakes to the pan. Cook for 2-3 minutes until onion becomes translucent.
Stir in dark soy sauce and brown sugar, cooking for 1 minute until sauce coats the tofu.
Add Thai basil leaves and toss gently until wilted, about 30 seconds.
Serve immediately over rice or noodles.