How can I fix a ‘500 Internal Server Error’ in my PHP WordPress site? [duplicate]

I’m building a custom WordPress theme, and I’m encountering a ‘500 Internal Server Error’ when trying to access the site.”

After updating my functions.php file, I started getting a ‘500 Internal Server Error’ instead of the homepage. I expected the changes to be reflected without errors.”