Much like in real life, fossils in Pokémon are pieces of ancient species preserved within the earth that can be uncovered by folks in the present. In most Pokémon games, players can pick up fossils that can be revived into living Fossil Pokémon for players to catch and train.

Fossils were first introduced all the way back in Gen 1 with Pokémon Red, Blue, and Yellow. There were three different fossils that players could find which could be revived into an Omanyte, a Kabuto, or an Aerodactyl.

Source: https://www.distractify.com/p/are-there-fossils-in-pokemon-scarlet-and-violet