How do I control the field of a custom doctyp

how do I control the field of a custom doctype
like generate a py file to control it

Welcome in community,
you can use customize form to edit or add new doctype
https://erpnext.com/docs/user/manual/en/customize-erpnext/customize-form

or custom script to control doctype field and event
https://erpnext.com/docs/user/manual/en/customize-erpnext/custom-scripts

thanks @OmarJaber after making a customize doctype it will be saved on my app at custom folder and now is it possible to make a file.py to do something for the customize doctype?

python and js file will generate automatically

sure if we create a new doctype, what abaout we create a custom doctype?
@OmarJaber