In a large pot or caldero, add oil, sofrito, onions, peppers, ham if using, garlic, bouillon and tomato paste and stir fry on high heat for a minute.
Add the seasonings and half of the water or broth and olives if using. Bring to a quick boil and add the gandules and rice. Top with remaining water or broth until the broth is ¼ inch above the rice. Try the broth to make sure the flavor is to your liking. Add any salt or seasonings to taste and stir well.
For extra flavor that will make your dish taste like Puerto Rican pasteles, follow this extra step. While you wait for the broth to come to a boil, peel and grate the green bananas using the fine shred/zest side of the food grater. You can also use a food processor or blender. Once the broth evaporates, reduce the heat to low, add the green banana mixture on top and spread around, cover with a banana leaf if you have it, cover with a lid and allow to cook for approximately 20-25 minutes. Do not uncover for at least 20 minutes. The rice should be fluffy and completely cooked through.
Turn the rice from the bottom up while incorporating the green bananas. Cover and let it rest for 5 minutes.