A possible always-answer to type-5 questions is "not much" (and there are various ways that that can typically happen, most boiling down to variations of "if it runs, it runs").
Anyway, stripping out all "non-essential" code gives:

By "non-essential", I mean that I don't know what the code is supposed to do, or be for, so it is not adding any functionality (my impression is that it is "accretion" code, e.g., copy-pastes accumulating uncritically over time (and there could be valid reasons for that)).
The basic setup is clear:
Code sets Hebrew as the main language, and defines two theorem-environments (quesh and example). Since I don't know what else it is supposed to do (cannot download the .tex file in the link to find out), I commented those extraneous parts out to see what effect they had (none, that I could see).
polyglossia loads fontspec, so loading fontspec again isn't really needed.
I don't have the fonts, so I just used some random ones.
Compiled with lualatex.
Looks OK.
Note: tcolorbox package has specialties in this area and could be useful (layout, formatting, styles, etc).
MWE
\documentclass{article}
\usepackage{amsthm,amssymb,amsmath}
\usepackage{polyglossia}
\setdefaultlanguage[numerals=hebrew]{hebrew}
\setotherlanguage{english}
%\usepackage{fontspec}
\newfontfamily\hebrewfont[Script=Hebrew]{David Libre}%{Hadasim CLM}
\newfontfamily\hebrewfontsf[Script=Hebrew]{FreeSans}%{Miriam CLM}
\newfontfamily\hebrewfonttt[Script=Hebrew]{FreeMono}%{IBM Plex Sans Hebrew}
\newfontfamily{\englishfont}{Noto Serif}%{Caladea}
%\newfontfamily{\englishfontsf}{Parix}
%\newfontfamily{\englishfonttt}{Merriweather}
%%% End of fonts
%%% Code downloaded from xitable
%\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\theoremstyle{remark}
%\newtheorem{question}{\protect\questionname}
\newtheorem{quesh}{שאלה}
%\renewenvironment{question}{\begin{quesh}}{\end{quesh}}
%\newenvironment{question}{\begin{quesh}}{\end{quesh}}
\theoremstyle{definition}
\newtheorem{example}{דוגמה}%{\protect\examplename}
%\makeatother
% \addto\captionsenglish{\renewcommand{\questionname}{Question}}
% \addto\captionsenglish{\renewcommand{\examplename}{Example}}
% \addto\captionshebrew{\renewcommand{\questionname}{שאלה}}
% \addto\captionshebrew{\renewcommand{\examplename}{דוגמה}}
%% \providecommand{\questionname}{שאלה}
%% \providecommand{\examplename}{דוגמה}
\begin{document}
\section{שאלות לדיון}
\begin{english}
Some questions and examples at the end of the lecture.
\end{english}
\begin{quesh}
מהי פונקציה רציפה?
\end{quesh}
\begin{quesh}
מתי שני המספרים הרציונליים $\frac{a}{b}$ ו $\frac{c}{d}$ שווים זה לזה?
\end{quesh}
\begin{example}
$3+2\mathrm{i}$ הוא דוגמה למספר מרוכב.
\end{example}
\begin{example}
$1+1$ הוא דוגמה למספר מרוכב.
\begin{english}Some more instructions.\end{english}
\end{example}
\end{document}
polyglossia has language definition files. If you look inside gloss-hebrew.ldf, you will see:
\def\captionshebrew{%
\def\prefacename{מבוא}%
\def\refname{מקורות}%
\def\abstractname{תקציר}%
\def\bibname{ביבליוגרפיה}%
\def\chaptername{פרק}%
...
The \addto\captionshebrew part is designed for user-adds to this list (another way is to add lines to the/a .ldf file directly), makes the processing/coding more systematic. It depends what you want to do and how you want to solve for it.
Update 1
Regarding the question in a comment: for auto-translate (besides Davislor's solution),use a variable name as the label/title of the environment, and add the translation text to both language caption sets.
Define the label (say, xyz) as a variable (say, \xyzname):
\newcommand{\xyzname}{XYZName}
Define a new theorem environemt xyz using that label variable-name:
\newtheorem{xyz}{\xyzname}
Now, tell polyglossia what to set the variable to when changing languages:
\addto\captionsenglish{\renewcommand{\xyzname}{XYZ}}
\addto\captionshebrew{\renewcommand{\xyzname}{רשת}}
Usage:
\begin{xyz}
רשת
\end{xyz}
Note: doing \setdefaultlanguage[numerals=hebrew]{hebrew} sets numerals to Hebrew for everything; without the option (i.e., \setdefaultlanguage{hebrew}), it looks like this:

MWE
\documentclass{article}
\usepackage{amsthm,amssymb,amsmath}
\usepackage{polyglossia}
\setdefaultlanguage{hebrew}
\setotherlanguage{english}
\newfontfamily\hebrewfont[Script=Hebrew]{David Libre}%{Hadasim CLM}
\newfontfamily\hebrewfontsf[Script=Hebrew]{FreeSans}%{Miriam CLM}
\newfontfamily\hebrewfonttt[Script=Hebrew]{FreeMono}%{IBM Plex Sans Hebrew}
\newfontfamily{\englishfont}[Colour=blue]{Noto Serif}%{Caladea}
\theoremstyle{definition}
\newcommand{\xyzname}{XYZName}
\newtheorem{xyz}{\xyzname}
\addto\captionsenglish{\renewcommand{\xyzname}{XYZ}}
\addto\captionshebrew{\renewcommand{\xyzname}{רשת}}
\begin{document}
עברית:
\begin{xyz}
רשת
\end{xyz}
%====================
\begin{english}
English:
\begin{xyz}
xxx
\end{xyz}
\end{english}
\end{document}
Update 1.a
Theorem-numbering
Defining a theorem environment also defines a corresponding theorem-number variable, which can be added to the captions list - in this case, polyglossia's hebrew module provides a \hebrewnumeral{} function.

A theorem environment xyz has a counter xyz, whose printable version \thexyz can be added to the hebrew captions after being converted with \hebrewnumeral{\value{xyz}}:
\addto\captionshebrew{\renewcommand{\thexyz}{\hebrewnumeral{\value{xyz}}}}
MWE
\documentclass{article}
\usepackage{amsthm,amssymb,amsmath}
\usepackage{polyglossia}
\setotherlanguage{english}
\setotherlanguage{hebrew}
\newfontfamily\hebrewfont[Script=Hebrew]{David Libre}%{Hadasim CLM}
\newfontfamily\hebrewfontsf[Script=Hebrew]{FreeSans}%{Miriam CLM}
\newfontfamily\hebrewfonttt[Script=Hebrew]{FreeMono}%{IBM Plex Sans Hebrew}
\newfontfamily{\englishfont}[Colour=blue]{Noto Serif}%{Caladea}
\theoremstyle{definition}
\newcommand{\xyzname}{XYZName}
\newtheorem{xyz}{\xyzname}
\addto\captionsenglish{\renewcommand{\xyzname}{XYZ}}
\addto\captionshebrew{\renewcommand{\xyzname}{רשת}}
\addto\captionshebrew{\renewcommand{\thexyz}{\hebrewnumeral{\value{xyz}}}}
\begin{document}
%---
\begin{hebrew}
עברית:
\begin{xyz}
רשת
\end{xyz}
\end{hebrew}
%====================
\begin{english}
English:
\begin{xyz}
xxx
\end{xyz}
\end{english}
%---
\begin{hebrew}
עברית:
\begin{xyz}
רשת
\end{xyz}
\end{hebrew}
%====================
\begin{english}
English:
\begin{xyz}
xxx
\end{xyz}
\end{english}
%---
\begin{hebrew}
עברית:
\begin{xyz}
רשת
\end{xyz}
\end{hebrew}
%====================
\begin{english}
English:
\begin{xyz}
xxx
\end{xyz}
\end{english}
\end{document}
\protectis defined in section 12.11 of LaTeX2e documentation. – user202729 Nov 08 '21 at 01:05