How can we tell whether a double beta decay is neutrinoless or not? If a double beta decay is neutrinoless, there will be no neutrino carrying the energy away and the electrons should carry the exact amount of energy of the decay. The problem is that because neutrinos are emitted in a continuous spectrum and neutrino masses are extremely small, it’s difficult (if not impossible) to rule out the possibility that two near-zero energy neutrinos are emitted. In single beta decay there is no such ambiguity as neutrinos carry a half integer spin, which means the angular momentum won’t be conserved without it. But in a double beta decay the angular momentum of two neutrinos can cancel out.
 A: By using a detector with excellent energy resolution.

The problem is that because neutrinos are emitted in a continuous
spectrum and neutrino masses are extremely small, it’s difficult (if
not impossible) to rule out the possibility that two near-zero energy
neutrinos are emitted.

The "difficult" bit is correct, the "impossible" bit is not. Many experimental collaborations search for neutrinoless double beta decay. One example is the GERDA experiment (now continuing as LEGEND). From one of their results papers comes this plot:

Shown in grey is the measured background after a lot of clever experimental work. Blue is the spectrum that is attributed to the two-neutrino double-beta decay, in this case of Germanium-76. Also indicated as $Q_{\beta\beta}$ and in red is the total energy of the decay. This is where you would expect the signal from neutrinoless double-beta decay to show up. For scale, note the gamma lines from radioactive Potassium ${40}$K and ${42}$K. These give you an idea of the excellent energy resolution of these detectors. Thus, given the statistics of this run, you do not expect any background from the two-neutrino decay in the region of interest to the neutrinoless decay. Had they seen a peak around $Q_{\beta\beta}$ it could not have been from the two-neutrino decay.
Note though that this feature is not a requirement. Other detectors have worse energy resolution but other advantages. Even if the two-neutrino decay leaks into your signal region, you can still fit its shape and subtract it from your measured spectrum. Though in that case indeed you do loose the possibility to distinguish the two decays on an event-by-event basis.
A: There are at least two main ways it can be done (of course, nothing prevents you from using both of them and using them as cross-checks on each other).
Measure The Electrons Only And Look For Missing Energy And Momentum
The way that neutrinos were discovered in the first place and the more comprehensive method is to look for them indirectly by looking at the electrons in the decays and to see if they can account for 100% of the energy in the system under conservation of energy and momentum principles.
Even though neutrinos don't have much rest mass, on average, they account for a share of the total energy of the decay products that was possible to detect with WWII era grade instrumentation and modern detectors are much better.
In double neutrinoless beta decay you have zero apparent missing energy which shows up in the kinetic energy and trajectories of the double emitted electrons, when in ordinary double beta decays, you should have an (on average) not terribly difficult to measure amount of missing energy in the electrons that fits a well defined distribution of momentum directions and magnitudes.
If you are willing to be model dependent, you know precisely how much energy a beta decay or a double beta decay should kick out, and so you just compare the energy you observe in decay products to the theoretical expectation in each case (with systemic uncertainties to reflect lack of 100% efficiency in your detectors after screening statistically for detector results that, for example, are obviously cases where there was a double decay but your detector only saw one electron).
Look For Neutrinos In Association With Electrons And Adjust For The Neutrinos Your Detector Misses Statistically And Background Noise
The other strategy is to put neutrino detectors in place. Now, since neutrinos have a very small cross section of interaction with almost everything, your neutrino detector isn't going to see every neutrino that actually decays. But, it is possible to determine to a fair degree of precision what percentage of neutrinos that pass through your neutrino detector are being detected. If you know how many neutrinos are being seen and your detector efficiency to reasonable accuracy, then you can place reasonable bounds on the total number of neutrinos being produced. (Ideally, you also adjust for neutrinos from sources other than the one you are measuring which create background noise which you can model and subtract out, and have a statistical elimination screen that excludes neutrino detections that happen without a corresponding election emission from your targeted source material.) You then compare that number to the number of neutrinos you would expect given the number of decays that occurred which you measured from an electron detector with a much higher efficiency since electrons have a much higher cross section of interaction because they have electromagnetic charge.
You then use the comparison to place statistical bounds on the maximum percentage of decays that could have been double neutrinoless beta decays, and analyze that statistically to determine if it is consistent with zero or not.
Adjust Statistically For Low Energy Neutrinos Emitted In Normal Double Beta Decay

The problem is that because neutrinos are emitted in a continuous
spectrum and neutrino masses are extremely small, it’s difficult (if
not impossible) to rule out the possibility that two near-zero energy
neutrinos are emitted.

You can do a model dependent calculation of the share of neutrinos that will have near-zero energy and fall below your detection thresholds (in both methods). You can also cite to different kinds of experiments, theoretical calculations ab initio, and Monte Carlo simulations to corroborate the reasonableness of your assumptions in doing so and to place reasonable bounds on your systemic error from this part of the experimental setup.
Then, you adjust the neutrino detections or electron energy measurements that you actually do make in much the same way that you do for the overall efficiency of the detector.
All these adjustments can get pretty involved, but fortunately, radioactive decays are very well behaved and predictable at a statistical level, so you can lean pretty heavily on the parts of the Standard Model that you aren't actually testing in the experiment itself, without worrying about introducing significant theory error. This allows you to overcome a lot of unavoidable limitations of your instrumentation.
Model Dependent v. Model Independent Data Analysis
The most straightforward thing to do once you have your data would be to do a hypothesis test statistical analysis against the null of no double neutrinoless beta decay that is the Standard Model expectation.
This allows you to do things like dramatically reduce the systemic error, for example, by establishing predicted ratio of double neutrinoless beta decay to regular (neutrinoful?) double beta decay, which cancels out sources of systemic error shared by both kinds of double beta decay detections.
But, to do that you need to be doing a model dependent test and the problem with that is that since double neutrinoless beta decay is already beyond the Standard Model "new physics" there are a conceptually near infinite number of possible models that could produce neutrinoless double beta decay. So, if you only hypothesis test the most "vanilla" Majorana mass neutrino model you don't really know how robust your results are to subtle changes in the underlying theoretical model.
In contrast, without doing a hypothesis test, you can get a much more model independent bound on the results, but at the cost of not being able to cancel out a lot of potential sources of systemic error and not having a clear target that you are looking for that you can optimize your experimental setup to see. So you end up with results that just say "the neutrinoless double beta decay width is no more than X" without getting to zero, instead of the most satisfying but somewhat self-deceiving conclusion "we've [found] [ruled out] neutrinoless double beta decay at the five sigma level" (self-deceiving because it always comes with the footnote "if this thing that we've never seen actually works the way we think it does."
The glory of the five sigma exclusion instead goes to somebody who didn't put the blood, sweat and tears into doing the experiment who free rides on your experimental result and does a quick calculation of an expected value with what every model the cool kids are using this week.
