Sauté onions: Heat the oil in a medium pot over medium-high heat. Add the onions and sauté for 4-5 minutes, until they begin to brown on the edges.
Add garlic and rice: Add the garlic and rice, stir well and cook for another 2-3 minutes, stirring often. Listen for the rice to begin "singing" it will begin to make a unique sizzling noise but do not brown rice.
Add remaining ingredients: Add the grated ginger, salt, water, stock and coconut milk and stir well. Add the kidney beans and sprinkle the thyme over everything. Add the whole Scotch bonnet chile (or habanero); it will season the rice much like a bay leaf would.
Cook: Bring to a simmer, then turn the heat to low and cover. The rice should be done in about 40-45 minutes, depending on the type of rice you are using (white rice and par-cooked browns will take less time). Check after 30 minutes.
Remove from heat, cover: Once done, remove from heat and cover for 10 minutes.
Serve: Fluff with a fork. Sprinkle with a little lime juice if you want. Discard the habanero.