The quality of the rice is probably the most important factor in making a risotto. Use Italian arborio, carnaroli or similar risotto rice.
Have the stock (or water) you are using on a gentle simmer on the stovetop next to a heavy-bottomed risotto saucepan. Melt the butter or olive oil in the risotto pan. Add the chopped onion and the other base vegetables you will be using such as celery, carrot or garlic, and sauté them until they have softened and are very lightly golden. Add the rice, stirring to coat it, and cook for a minute or two. Add the wine, if using, and when it has evaporated, add a couple of ladlefuls of hot stock. Stir with a wooden spoon. Season with salt and pepper, and any other seasonings. Continue to add more hot stock as it is absorbed by the rice, stirring all the time to prevent it from sticking. If the stock is used up before the risotto is ready, continue adding hot water. The total cooking time of the rice should be about 25 minutes. After the risotto has been cooking for about 20 minutes, taste it to check the seasoning and the texture. It should be soft, yet quite firm and have a fairly liquid, creamy texture. Add a generous nut of butter and freshly grated parmesan cheese. This will hold the risotto loosely together. Add any chopped, fresh herbs and serve sprinkled with extra Parmesan cheese.