The EAN-13 barcode on a product in a shop is not a random number. It contains a company prefix registered in the international GS1 system, which makes the product unique worldwide. Retail chains and marketplaces usually require GS1 numbers.
To get numbers, the manufacturer or brand owner joins the national GS1 member organization in their country and assigns a number to each product. Check the terms and fees with the GS1 organization directly, as they can change.
Once you have the numbers, print the codes at the right size and contrast, or they may fail to scan at the checkout. BDB can help with label printers, labels and checking print quality.