Science has since time immemorial been looking for ways to say something about VO2max without a laboratory setup. It should be mentioned that 50 years ago it was thought that VO2max was poorly trainable and therefore a great predictor of sports talent. In this article you can read more about this and what exactly VO2max is.
There are actually two ways to distinguish in these calculations.
 Based on maximum effort, as in a 5 max allout effort (1) on the bike.
 Based on a submaximal effort, as with the Astrand Nomogram (2) or the First Beat calculation (3) common in Garmin devices.
The first way is actually the most accurate method, right after, of course, direct laboratory measurements. After all, here you measure the maximum output and then calculate back to how much energy the body needs to produce for this. This is how we know that a person’s maximum 5minute value is highly correlated to Vo2max. Through this way, no standard corrections have to be applied for age and gender and these errors can be avoided. However, you do actually make assumptions for efficiency and (cycling/running) technique. Still, these formulas turn out to usually explain around 95% of the variance, which is often acceptable in terms of margin of error. (1)
Because humans are lazy by nature, there are also calculations where you do not go allout. These methodes are usually based on the ratio of power or running speed and heart rate maximum values. These types of formulas extrapolate the ratio and apply corrections for age and gender. The best known way is Astrand’s nomogram from 1954 (2). This uses a line drawn between heart rate and power output from a simple submaximal test to predict Vo2max. This method has been improved and validated many times over the past 60 years (4/5) and still seems to give reasonable values. Fortunately, this graph has now also been converted into a formula, which you can use using the calculator in the link below. (5)
How this test works and how to use this test yourself can be found here on this page.
The Garmin calculation
The method used in Garmin devices today is basically an updated version of the Astrand method from 1954. Unfortunately, Garmin’s exact method is kept secret. So we don’t know what correction factors for age and gender are used, nor what the exact formula is for extrapolating heart rate and power. We do know that this calculation requires you to have at least 20 minutes of power data with a heart rate of 70% of maximum heart rate or higher. This method is said to be quite accurate, but thus not very extensively validated in science. The accuracy of this measurement is said to be at 95% in running and 92% in cycling. These are very nice values and in almost every training you can then make a prediction of the Vo2max and follow it through time. (3/6)
To conclude
The question remains as to what exactly this value says about a person’s cycling capabilities and why not extrapolate, for example, to maximum power values or running speeds. Then you can avoid any discrepancies in the standardized corrections for age and gender. In addition, the power outputs can be used in determining the appropriate intensity in future workouts, whereas you can’t really do anything else with the Vo2max value.
VO2max calculators
But to not leave you completely emptyhanded, here are two calculators with reference to the scientific evidence.
References
 Sitko S, CirerSastre R, Corbi F, LópezLaval I. FiveMinute PowerBased Test to Predict Maximal Oxygen Consumption in Road Cycling. Int J Sports Physiol Perform. 2022 Jan 1;17(1):915. doi: 10.1123/ijspp.20200923. Epub 2021 Jul 5. PMID: 34225254.

A Nomogram for Calculation of Aerobic Capacity (Physical Fitness) From Pulse Rate During Submaximal Work
 https://www.firstbeat.com/wpcontent/uploads/2015/10/white_paper_vo2_estimation.pdf
 Siconolfi SF, Cullinane EM, Carleton RA, Thompson PD. Assessing VO2max in epidemiologic studies: modification of the AstrandRhyming test. Med Sci Sports Exerc. 1982;14(5):3358. PMID: 7154887.

Buono, M. J., Roby, J. J., Micale, F. G., & Sallis, J. F. (1989). Predicting maximal oxygen uptake in children:modification of the AstrandRhyming test. Pediatr Exerc Sci, 1:278283.
 https://www.firstbeat.com/wpcontent/uploads/2017/06/white_paper_VO2max_30.6.2017.pdf