Prod it with a needle. If it is yellow, soft and doesn't break it probably is gold. If it breaks off just squeeze it with some flat pliers. Gold is malleable and just expands in size as it gets thinner. If it is pyrite or some other sulfide it will crush into a black powder.
Streak color, rub it onto an unglazed piece of porcelain like a fuse and watch the color. Pyrite and other sulfides often have black or black with a bit of color while gold has a yellow streak. Most silicates have a white streak.
Gold is also a very good electric conductor, so a multimeter can measure resistance. Metals are down at 1 ohm or less, sulfides often at 20-200 ohm and oxides at kilo ohm and higher.
Chemically you can wash it in nitric acid first, gold isn't dissolved in nitric while many other minerals are dissolved.
Then use aqua regia, it dissolves gold while many other minerals doesn't dissolve. If it dissolves then you can test the liquid with stannous to get a positive result.
Use an XRF, it will tell you directly as it is on the surface.
These are just a few tests you can do. Most of them just tells you it probably is gold or if it fails that it isn't gold.
Gold on quartz.
Yellow gold grains on pyrite, notice color difference.
Göran