>>2019598building a wheel is time consuming and there's more of a learning curve than other bike stuff.
spoke length is determined by the hub width, hub flange height, rim diameter, and the lacing patern (you want 3x, which is standard, or maybe 4x for heavy brick shithouse. the spokes cross each other and make multiple triangular shapes per spoke as you have seen. sometimes you see a race bike with a radial or 0x pattern, which looks different since it looks like pieces of pie). the spokes have to be within a few mm of correct or it won't work.
luckily now there are online spoke calculators but you still have to measure your hub and the rim diameter of where the spokes meet the interior surface (different than the tire size measurement.)
if you're lucky you can get the numbers from the spec sheets online.
then you have to bring all the spokes up to approximately equal tension (feel them against a known good wheel of similar build but your rear wheel has no motor, smaller flange, longer spokes; so you can't use it as a guide like you usually would) or there's an expensive tool that measures the tension.
then you have to true the wheel, adjust the individual spoke tension to pull or push out the slight differences until the rim is perfectly straight.
there's tons of online directions. you can do it but if you go too fast you'll fuck something up and have to backtrack. it is a slow, often frustrating process. experience is how you get good and confident. usually people learn by truing the wheels they've bent for a while before attempting a full build.