How can I prevent a function from loading in the admin screens?

You can use the is_admin() function to check:

add_action( 'init', 'hekim_sticky_header' );
function hekim_sticky_header() {
    if ( is_admin() ) {
        return;
    }
    // Rest of your function goes here.
}