There's lots of techniques, both commercial and home-brewed, but my first go at this is always a good vinegar soak. White vinegar is cheap, easily available and is a fairly mild acidic (5-20%) so it won't hurt painted or rubber items, as long as it's wiped clean and not allowed to sit for long periods. If possible, I source white vinegar as opposed to distilled white vinegar, as the non-distilled is stronger, but during these days of thinly-stocked store shelves I was only able to find the quantity I needed (5 gallons) in distilled; $1.79 per gallon. I read on the interwebs that you can fortify the acidic strength by adding a cup of salt per gallon, so I gave that a try. I have no way of knowing if it helps, but I had good results in any case.
Each day I peek inside the filler with a flashlight til it's evident that the rust has dissolved. The drained vinegar can be reused or simply discarded down the drain.
Next, shake the screws out. TIP: By resting the tank on its back, any remaining items can be retrieved through the fuel sender hole with a magnet. Then a thorough flush with the garden hose through the top and bottom openings till the water runs clear. At this point I take the opportunity to blow-back through the fuel petcock to clear the lines.
Finally, to prevent flash rusting of the bare metal, I add some sort of oil-based coating. I like Marvel Mystery Oil, cylinder fogging spray or WD-40. Anything to displace the remaining water and coat the bare interior metal.
Wipe the exterior, install the sender with a fresh o-ring gasket, and this tank is ready to use.
There's other treatments out there, like Sta-Bil, but this stuff works; it's cheap, it's available at Walmart, and all you need is an ounce added to your bike's tank to afford you peace of mind while your bike waits contentedly in its corner of the garage. Please. Use. This. Stuff.