Need help to wright code for me

i am making project for my home and confuse how to write code for my esp32.
i am not well code writer.
i have esp 32 with LDR sensor, PIR motion Detector sensor and 8 channel relay.
i want to operate Relays normally by Blynk buttons and relays should sync with blynk last status, when its restart and connect with network each time.
plus two relays toggles when motion detected by pir sensor, when no light in the room by LDR sensor.
i mean light should on when no light in the room, if there is light PIR sensor should not response.

I’m not sure that you’ll get anyone to do your code development here, it’s not really what the community is about.

You might be better here: