The Arduino can only do one thing at a time, hence your problem
In the simple case that you posted you could put a digitalWrite() for both pins in the same function, but that is not a general solution. In order to make the Arduino appear to do more than one thing at a time you need to use a different strategy to do the timing so that doing one thing does not block the running of a second thing
I typically follow the convention of putting setup() first, no matter it works wherever you put it in the *.ino file. That's where I look for it, and usually that means I don't have to. Look for it.
To me it's like the ingredients part of a recipe. A very good and almost always the first thing to read as one is, um, reading the code. That and other things that are also placed first.
The stuff up top, including setup(), informs understanding of the rest of the sketch. It can be the source of clues about the loop() to come, as well as clues about the programmer's level of incompetence.
Placing it elsewhere is srsly swimming upstream, the kind of thing for which there is no good reason. Like using red wire for GND and black wire for Vcc.
when posting code on this forum, i try to put the most meaningful code near the top so that it might appear early in the truncated window showing the code in the post. in this case, there was no need to scroll down to see loop().
in standard C/C++ development (not Arduino) function symbols must be known before being used, so i typically put main() at the bottom and order functions so that a() is defined before b() where it is called from, otherwise a prototype declaration is required void a(); is needed before b().
But in C++ struct is a class, the only difference is the default access modifier, in struct it's public in class it's private. The rest is the same. So when you create your struct you first implicitly call a constructor that you don't use.
In this example, the init() calls Serial.print() so you can't use a constructor. A constructor could be called before the rest of the Arduino enivornment/hardware has been initialized and the Serial call could fail. That is why many classes have the .begin() function.