On public land – Bureau of Land Management (BLM) land - you would put it in your pocket. Then you’d make a careful note of the GPS location, abandon the rest of your hiking plans and carefully examine the surrounding area to look for a surface outcrop. If you found one you would note the GPS location, run not walk to the BLM office and file a mineral claim.
But normally you would not find an outcrop nearby, and you don’t want to file a claim on a barren piece of ground. Gold nuggets are generally formed in water courses - streams and rivers - where the gold particles are tumbled and pushed together until they meld. Gold from a lode is almost never free from the rock (usually quartz) it was deposited in. So check carefully the place where you’re walking. Is it gravel, like an ancient stream bed? Quickly go home, get a gold pan and a shovel, then start working back up the stream bed. Every few yards, dig down to the bedrock and wash a few pans, looking for gold dust traces. You will almost certainly find some, if the nugget was formed where you found it. Keep working upstream until the gold disappears. Then you know the outcrop is in the hillside somewhere, above and just behind you. Find it, chip out as much gold as you can carry, then hurry to the BLM office to file a claim.
While you’re at it, you may as well also file a placer claim on the area where you found the nugget. You never know.
Here is some useful information from the BLM about how to stake a claim.
The governing law is the Federal Mining Law of 1866, with later amendments. It used to be that in order to hold a claim you had to do $100 of work on it annually. That was significant in 1866, but not so much nowadays. Since the BLM rarely checked to see if you had actually done the work, and relied only on your word, you got the absurd situation where claim squatters would hold hundreds of thousands of claims, hoping that some uninformed punter would discover minerals on one of them so that the previous claim holder could pop up and take it. Now you have to pay the “annual assessment fee” in money - the BLM will no longer take it in work - so the vast majority of these older claims have lapsed. If you go prospecting it’s always a good idea to contact the BLM for a current claim map.
If you hold a claim for a number of years and extract demonstrated value from it, you’re entitled to “patent” it. That means you effectively get title to the land and minerals for ever. There are very many abandoned claims that have been patented, and if you try to develop them you run the risk that the patent holder or their heirs will appear out of nowhere and sue you. About 25 years ago Congress became concerned by the way people would stake a claim in some attractive national forest, work it for five years, patent the claim and then build themselves a very nice house on land they could never have obtained any other way, so they put a stop to it by prohibiting the BLM from using any funds to process patent claims. Therefore no claims have been patented since the 1990s. BUT - the mining laws are constantly under attack by environmentalists and may one day be repealed, and if that happens, there may well be a last-chance opportunity to patent. A lot of people are holding on to otherwise worthless claims just in case.