Prepare the Tofu
Remove the tofu from its package.
If using super firm tofu, pat it dry and slice it into 1-inch cubes.
If using extra-firm tofu, press it first by wrapping it in paper towels or a muslin cloth. Place it on a plate, weigh it down with a stack of plates or a small pan, and let it sit for 20 minutes before slicing.
Pan-Fry the Tofu
Heat 2 tablespoons of oil in a large non-stick pan over medium-high heat.
Add the tofu pieces in a single layer, working in batches if necessary to prevent overcrowding. Sprinkle with 1/4 teaspoon salt.
Pan-fry the tofu for 3 minutes on one side until golden brown. Flip and repeat, adding 1/4 teaspoon salt each time.
Continue frying on at least 4 sides until the tofu is crispy and golden. (Total salt used should be about 1 teaspoon.)
Remove from heat and set aside.
Cook the Sauce
Heat 2 tablespoons of coconut oil in a large skillet over medium to medium-low heat.
Add the shallots and cook, stirring frequently, for 4 to 5 minutes until softened.
Stir in the minced ginger and cook for 30 seconds to 1 minute, until fragrant.
Add the coconut milk, sambal oelek, red curry paste, coriander (if using), salt, and sugar.
Increase the heat to medium-high and let the sauce simmer for 3 to 4 minutes.
Combine and Serve
Turn off the heat and add the fried tofu to the skillet. Stir until evenly coated in the sauce.
Transfer to a serving dish and garnish with scallions, red pepper flakes, and toasted sesame seeds.
Serve hot with jasmine rice and a side of roasted asparagus or blanched broccoli.