How to edit post meta data before publishing the post it self wordpress?

You can use save_post action which gets triggered when a post is created or updated.

https://developer.wordpress.org/reference/hooks/save_post/

In your function, you will have to check for your custom post type, set the value you would like to have to a variable, and pass it to the update_post_meta function with giving the name of your custom field.

function my_update_on_save( $post_id ) {

   if ( get_post_type($post_id) == 'your_custom_post_type' ) {

        // Do nothing if this is a post revision
        if ( wp_is_post_revision( $post_id ) )
        return;

        $value="your value";

        update_post_meta($post_id, 'your_custom_field_name', $value);

    }

}
add_action( 'save_post', 'my_update_on_save', 10, 2 );