How do I sweat onions?
First, finely chop the onions.  This makes them smaller, faster-cooking, and less of a textural presence in the dish.  Do it by cutting straight through the poles of the onion, resulting in two halves.  Then chop off the knobs and peel off the outer layer.  Run the knife 8 or 9 times along the vertical (from pole to pole), but don't sever one end completely.  Cut finely across these verticals to make a fine dice.  Run the knife over the pile a few times if your cut isn't small enough.

Second, cook the onions. The purpose of sweating is to draw moisture out, concentrating the flavor and enhancing conversion from starch to sugar. Heating the onions releases their aroma and reduces the chemical bitterness they exhibit when raw.  Heat up some oil in a pan to medium-low heat.  Add the onions.  Add salt.  I wouldn't cover the pan, since the lid will prevent steam from escaping.  Stir/shake to prevent sticking or burning.  The onions will get soft and then translucent. (Eventually, if you kept going they would get limp and browned; this is referred to as caramelized and considered a different thing than sweated, so although it's just further along the same spectrum, you shouldn't go that far for this recipe).

That's how I'd do it and why.  I don't know if it's a textbook answer.