Magnets do not capture gold, but they can help to capture some of the black sand which is heavy and hangs with fine gold.
Magnets can be used in fishing for black sands can pick up some gold which gets stuck in the batch of black sand as the magnet attracts it and clumps it magnetically together.
I don't think I will worry about putting magnets in my sluice box, I would worry more about angle, water flow and good miners moss or good sluice box matting to capture the gold and heavier black sands...