I finally remembered to ask my DH your question.
We have a plumber buddy and he and my DH service our tankless water heater once a year.
My part in it all is that before they do whatever it is they do, I buy 2 half gallon containers of vinegar. While they are doing whatever it is they do, I go to the rib place and pick up lunch for us all.
I just asked my husband what it is he and plumber buddy do. He said they unscrew the cover on the part of the water heater that is outside. Then they clean all the contacts with a dollar bill. Then they shut off the water feed to the water heater. Then they flush it all out with vinegar. Our plumber buddy has some type of re-circulator machine thingie that he puts in a bucket and the machine runs the vinegar through the water heater several times.
Then they eat lunch. Then they do it all again. Then they everything back together. Then they are done.
The yard and the water all smell like vinegar for a few days afterward.
We have had our tankless water heater at least 10 years. It uses natural gas. We live in an area of the U.S. where it only gets below freezing temps about 20 days a year so it is fine in our area that most of the tankless water heater is outside. Also, we have one of those basic tankless kind of water heaters where it takes 2 - 3 minutes before the hot water gets to the faucets in the house.