Updated to PHP 8.0 and WordPress site not working

You cannot change something in the referenced file, since it’s part of the core. Ok, technically you can, but you really really shouldn’t.
Even the latest wordpress is not yet production-ready to be compatible with PHP 8 – https://make.wordpress.org/core/2020/11/23/wordpress-and-php-8-0/

However, wordpress 5.6+ is beta-compatible, so your best course of action is to upgrade wordpress. If this is not solved, then you either have to downgrade the server to PHP 7.4, or wait until wordpress releases a fully compatible version (hoping that in the next few weeks/months with the release of wordpress 6).