A couple handfuls of nuts and bolts or better a length of chain (easier to remove), add a quart of kerosene or mineral spirits and shake and tumble thoroughly. Drain the solvent and repeat until the solvent comes out clean. Finally use a quart of MEK or acetone as a final rinse and let it dry open overnight. After draining and air drying overnight, blow it out with some compressed air to finish drying. MEK and acetone are very flammable and volatile so keep it in a well ventilated area away from ignition souces.
When you are satisfied it is clean and DRY coat it immediately with your favorite, POR-15, RedKote, or Caswell epoxy. Let it cure for at least a week before adding gasoline.
If you are saving your paint job, be careful with the MEK and acetone as they will destroy most paints.
Alternatively, take it to a local metal cleaning specialist. Make sure you talk to them about what you are doing. The tank will come back clean inside and out, but most are not used to doing motorcycle tanks and can be returned with small dings and scrapes which need to be repaired (DAMHIK). Line and prime the tank ASAP to prevent rust from reforming. This costs me $60 per tank so with the extra work to repair the little dings I usually do this only if the tank is really rusty.
If it is a really rare tank like a long range fastback or steel Interstate tank, I would consider sending it to Ross Thompson who will cut the bottom out, clean it, repair any little dings, re-weld the bottom and line the tank. It comes back better than new and will need no bondo before paint. He is truly a metal working wizard. The cost will run 500-700 dollars depending on how much metal work is needed.