In the same way that we get gold today: they mined it or traded for it.
The eleventh century Latin textbook known as Ælfric's Colloquy takes the format of a series of stylised conversations between a class and community figures. A conversation with a merchant is as so:
Merchant: I embark on board ship with my wares and I sail over remote seas, sell my wares and buy precious objects that are unknown in this country. I bring these things to you over the sea enduring great danger and shipwreck with the whole of my goods hurled overboard and with me hardly escaping with my life.
Teacher: What sort of wares do you bring us?
Merchant: I bring purple cloth and silk, precious stones and gold, various sorts of clothes and dyes, wine and oil, ebony and brass, tin and brimstone, glass and like products.
Within the British Isles, gold was mined primarily in North Wales, although also in Cumbria. Throughout the Medieval period, the Hungarian town of Kremnica (now in modern Slovakia) was one of the most prominent gold mining locations in Europe, with sub-surface mining beginning around 900AD.