Automatically add tag if a checkbox is checked

If I understand what you want I would call it on the save_post hook:
https://codex.wordpress.org/Plugin_API/Action_Reference/save_post

So the code would be something a little like:

    function wphuyeh8_save_post_tag( $post_id, $post, $update ) {
    // If example is set and not false
    if($_REQUEST['_example']):
        // set the tag
            wp_set_post_tags( $post_ID, 'example', true );
    else:
        // remove the tag if the checkbox is not checked
            wp_remove_object_terms( $post_id, 'example', 'post_tag' );
    endif;
}
add_action( 'save_post', 'wphuyeh8_save_post_tag', 10, 3 );

Though this is untested, and taking a second glance it will try and remove the tag on every post save unless it is checked so you may want to add in some checking for a post type or something.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)