The easiest way to set pin state shortly after boot is to use the gpio config command in config.txt.
NOTE The syntax is based on the raspi-gpio utility -
raspi-gpio help
will show commands.
See https://www.raspberrypi.com/documentation/computers/config_txt.html#gpio-control
NOTE this is not strictly at boot, this is done by Device Tree but very early in the boot process. On boot all pins are set as inputs.
You will have to write your own procedure to change them (using any of the normal methods).