IDs are your friends. Get the category list using get_category (i’m assuming we are talking about the in-built WordPress “category” taxonomy, which slug is category).
$categories = get_categories( array(
'hide_empty' => false // This is optional
) );
Use the obtained category list in the output of your <select> field:
<?php // get $selected_term_id from somewhere ?>
<select name="category_id">
<?php foreach( $categories as $category ) : ?>
<?php $is_selected = $category->term_id == $selected_term_id ? 'selected' : ''; ?>
<option value="<?php esc_attr_e( $category->term_id ); ?>" <?php echo $is_selected; ?>><?php esc_html_e( $category->cat_name ); ?></option>
<?php endforeach; ?>
</select>