I parboil my rice, about half an hour in stock to make this go quicker, and it lets some of the starch from the rice go in the stock.
Add 1 Tbs of the butter to a medium pan, add the shallot and garlic and sweat for a few minutes (you can add some white wine here, but I never do)
Add the rice and let it toast till you have nearly a dry pan.
Add a ladle of stock at a time, stirring and letting the rice take in each ladle before adding the next. Might take more stock, might take less.
When the rice is at the desired consistency , remove from the heat and "swirl" in the other 2 Tbs of butter, swirl don't stir, and always use a wooden spoon.....why?, I'm not sure, but I was taught to and it works.
optional. classically, you would add parm cheese here and let it melt in, depending on the rest of the meal, I'd make that decision later.