How to write an iso image to a usb flash drive and add files to the image?

Depends on what distribution you want? Example propably archinstall is for arch.
Fedora is "everything"
Ubuntu is Create Your Own Distribution Based on Ubuntu
Propably somewhere here i put some tutorial.
Remastered Zorin