How to make this necklace?

check sphere packing and circle-packaging…

for example here:

the volume to fill is a torus as a starting point, for better anatomy you might need something more detailed

https://docs.mcneel.com/rhino/7/help/en-us/index.htm#commands/torus.htm

hope this get s you started … kind regards - tom