Affinity Tomes are powerful artifacts that can be found very rarely in loot chests. They come in eleven variants, one for each affinity plus a special none-type variant. Using an Affinity Tome will give you a noteable boost in its affinity, while reducing your shift into all other affinities. They are the only means currently known to break an affinity lock.
Water affinity tomes can be found in underwater structures, such as Underwater Ruins or Shipwreck treasures.
Fire affinity tomes can be found in Bastion treasures, guarded by Piglins alongside their other valuables. If you are very lucky, you might also find one in a Nether Fortress.
Earth affinity tomes can be found where miners left their remains. Thus, Abandoned Mineshafts or Dungeons are the best locations to start searching.
Air affinity tomes can be found as a reward in Trial Chambers, home of the Breezes.
Ice affinity tomes can be found in cold biomes. Igloo laboratories should be double-checked!
Lightning affinity tomes can be found in dry and arid places. Most of them have been hoarded in Desert Pyramids.
Nature affinity tomes can be found hidden in lush places, such as Jungle Temples.
Life affinity tomes have a special way of appearing. Any place other affinity tomes can spawn at, you have a very low chance to encounter a life tome instead.
Arcane affinity tomes are found in the homes of the sorcery-wielding Illagers. Woodland Mansions and, to a lesser degree, Pillager Outposts are prime examples of that.
Ender affinity tomes can be found in the only End structure known to yield any loot - the End City. Some have also managed to bring these tomes back into Stronghold libraries.
None-type affinity tomes are found in the most nihilistic and dangerous structures of all: the Deep Dark's Ancient Cities.
These tomes are special because they do not have an affinity associated with them. As such, they lower your shift into all affinities, without buffing anything.