how to add custom select field to wordpress edit page

A legacy solution is to add_meta_box() and set its context as side. This makes the custom metabox visible in the block editor Document sidebar.

The modern way is to add a custom panel with Block API.

Or if you’ve registered a custom taxonomy with register_taxonomy(), then you need to have show_in_rest parameter set to true to make it visible in the block editor.