How to make a can’t hide widget?

to block the ablility to hide it, you can use that :

const WIDGET_TO_SHOW = "example_dashboard_widget";


add_filter("get_user_option_metaboxhidden_dashboard", function ($result, $option, $user) {

    $result = array_diff($result, [WIDGET_TO_SHOW]);

    return $result;

}, 10, 3);

this is just server side. to be more clear for the user, you can use JavaScript to hide the checkbox in “screen options”.