Sort kidney beans, remove debris, rocks, or damaged beans, and wash and drain kidney beans in a colander. If using canned kidney beans, drain beans and skip to 4
Place kidney beans in a large bowl and cover with water, making sure there is enough water for them to double in size (about 2 inches above the beans). Let the beans soak for at least 6 hours or overnight. Drain the beans after soaking and rinse using a colander.
Place kidney beans in the Instant Pot and add 3 cups of water. Cover the Instant Pot securely, and turn the valve to the sealed position. Manually set Instant Pot to cook beans for 8 minutes at high pressure. When the timer goes off, use the natural release method, do not open the valve and allow the pressure to release naturally.
Meanwhile, sort and wash rice using a fine mesh strainer and set aside. Remove the lid, and add the onion, green onion, garlic, ginger, coconut milk, and rice. Stir to incorporate rice with all the other ingredients fully. Add allspice, thyme, and salt, and stir again. Add Scotch bonnet pepper or cayenne pepper. *If using canned kidney beans, add them along with 2 cups of water.
Close the lid securely and turn the valve to the sealed position. Manually set Instant Pot to cook rice and peas for 22 minutes at high-pressure
When the timer goes off, allow steam pressure to release for about 20 minutes naturally, and turn the sealing knob to vent to release the remaining pressure. Remove lid and discard Scotch bonnet pepper, fluff rice, and it's ready to serve.