Drain the tofu and wrap it in a clean kitchen towel or paper towels. Place a heavy object on top and press for 15–20 minutes to remove excess moisture. Cut the tofu into bite-sized cubes and pat dry again.
Place the tofu cubes in a mixing bowl. Sprinkle with cornstarch, salt, and black pepper. Toss gently until each piece is evenly coated. Shake off any excess cornstarch to keep the coating light.
Heat 2 tablespoons of vegetable oil in a large nonstick skillet over medium-high heat. Arrange the tofu in a single layer without overcrowding the pan. Cook for 8–10 minutes, turning occasionally, until the cubes are golden and crisp on all sides. Transfer to a plate lined with paper towels.
In a small bowl, whisk together the rice vinegar, ketchup, soy sauce, brown sugar, pineapple juice, cornstarch, and water. Stir until the sugar dissolves and the cornstarch is fully incorporated. Set aside.
Heat the remaining tablespoon of vegetable oil in the same skillet over medium-high heat. Add the minced garlic and grated ginger, cooking for about 30 seconds until fragrant. Add the red bell pepper, green bell pepper, and red onion. Stir fry for 3–4 minutes until slightly tender but still crisp.
Stir in the pineapple chunks and cook for another minute. Give the prepared sauce a quick stir, then pour it into the skillet. Cook for 2–3 minutes, stirring continuously, until the sauce bubbles and thickens into a glossy coating.
Return the cooked tofu to the skillet. Gently toss everything together until the tofu and vegetables are evenly coated with the sweet and sour sauce. Cook for another minute to warm the tofu through.
Turn off the heat and sprinkle with sliced green onions and sesame seeds. Serve immediately over steamed rice or alongside your favorite noodles.