I am not sure exactly how many motorycle tanks I have cleaned - but it is probably approaching 20 or so. Most of them have been from old bike projects/barn finds that I have purchased. There has been a bit of a learning curve, and I believe I now have a system that works very well.
1) If the tank you want to clean is operational and has fresh fuel in it, then you can skip this step. If the tank is on an old bike and the fuel is stale or has dried up and left a varnish - then you need to fill it with fuel and let it sit for a while to soften up the old fuel varnish. I use Avgas 100LL to do this - but anything you can find will be better than nothing. When it has sat in the tank for a while (hours is OK, days is great, weeks is better), then dump the fuel out and proceed to step 2.
2) With the tank off the motorcycle, remove the petcock, and make a plate to block off the petcock hole. I use a small piece of metal that I get at the hardware store, a piece of flat rubber, and the petcock screws. You will need to drill holes in the plate and cut holes in the rubber to allow you to bolt the plate over the petcock hole. In this photo there is only one hole - this is from a plate I made for a Honda tank that only has 1 screw holding the petcock on.

3) The next step is to clean the tank. I use some form of strong degreaser such as Simple Green, Purple Power, etc. I use it full strength at first and you only need to dump in about 8 0z at first. Once you have the cleaner in, then put a large handful of drywall screws in the tank with the cleaner, and put the fuel cap on. Then pick up the tank and start shaking back and forth, up and down, left a and right, and periodically rotate the tank right side up, left side up, downside up, etc. You can shake left and right to slide the screw along the surface, and up and down to impact the screws onto the surface. I have tried using nuts and bolts instead of screws - but the sharp points and edges of the screws do a better job, and the screws ares small and light enough that they won't dent the tank. Wipe any cleaner that leaks out of the cap off periodically so that the cleaner won't discolor the paint. When your arms are tired, get a small pan and take the gas cap off and emply the tank into the pan. The liquid, screws and rust flakes will be dumped into the pan, and you will have to shake the tank up and down to get all the screw out....however at this point you don't need them all out - you need to keep repeating this process until the cleaner comes out pretty clean. You can dilute the cleaner with about 50% water after the first cleaning and it will be easier on the paint. To get the screws out of the cleaner and rust I use a magnet to pick them out of the pan and put them back into the tank.

4) At this point your tank probaby has all the loose rust and varnish out - but it sill has the surface rust and rust pits in place. I have tried the acid routines in the past - but it is destructive to the base metal, paint, and is somewhat dangerous. Now I use a product called Evapo-Rust and avoid the acid mess. You can get it at Tractor Supply and most auto parts or hardware stores, and it is about $ 23 a gallon. The stuff is harmless to paint, your hands, it doesn't give off any vapors, and it is re-usable. The instructions say the temperature has to be above 65 degrees for it to work well, and they claim in takes 3-4 hours. Well I agree with the temperature part - but for most of the tanks I have done it takes 1-3 days to get the rust off. I dump the Evap-Rust into the tank and put the cap on, then rotate the tank every few hours to get a different part of the thank submerged. If your fuel cap leaks then I take the cap off, wipe the lip clean and dry, then place a piece of good duct tape over the hole and cup my hand over the tape to hold it tight while I rotate the tank. It is not absolutely necessary that every part of the tank be submerged, so just rotating the tank to get the Evapo-Rust up around the filler neck area every few hours is sufficient. Some of the rust may come loose and fall off while soaking - but visually you may not see much of a change. Periodically put a small screwdriver or wire brush in the tank, and see of the rust comes off when you scrape at it.

5) When you think it is time, carefully dump the Evapo-Rust out of the tank and back into the container......it can be used for several tanks. Then take your trusty drywall screws and put them back into the tank and do the shakey-shakey thing again. Keep shaking and check to see if there are any trouble spots that need some special attention. Once you think you have done a good job, dump out the screw, rinse out the tank with hot water, and see what it looks like. You need to keep rinsing until the water comes out clean without any grit or rust particles. If you think it needs some more rust removal, shake out as much water as you can and then put the Evapo-Rust back in and rotate the tank to coat everything with the Evapo-Rust. If the tank is clean after rinsing with the hot water.....then shake out as much of the water as you can as quickly as you can.
6) The water is necessary to clean out the Evapo-Rust and any loose rust that remains. The bad part is that the water often leaves a flash rust coating on the surface. In order to get rid of this another step (and chemical) is required. A small amount of Phosporic Acid can be dumped into the tank - just enough to be able to coat everything inside the tank. Slosh this acid around and after 2-3 minutes dump it out of the tank and into a bucket of water to dilute it. Wipe any anything that spills onto the paint quickly. In the old days I would used Acetone to clean out the tank at this point....however Acetone is a very strong solvent and will eat paint. My newest trick is to use E85 from the gas station. The Ethanol will remove the Phosporic Acid, does not hurt paint, and is 1/4 the cost of Acetone.

I found out how difficult it is to photograph the inside of a tank with my cheap camera. This tank is from a Honda that was last run in 1967, and had fuel in the tank when it was parked 46 years ago. The tank was completely brown inside with old fuel and rust. After treatment as described above, it is now clean and shiny inside.

COATINGS - Lining the tank with a coating is an option. If the conditions that caused your tank to rust will be repeated....then maybe you should line the tank. Bikes that sit for extended periods, are stored outside, under tarps or in unheated garages are more likely to have problems. I line most of my tanks if they are going to be using ethanol pump gas. My current favorite coating is the epoxy sealer from Caswell Plating - pay special attention to the temperature requirements in the instructions as it does not flow well when cold, it is clear and will not hide anything and whatever your tank looks like inside will show through the coating. My next favorite coating is POR15, it is a bit cheaper and does have a nice silver color that looks natural in the tank.