Basically the periodic table of elements is what alchemist used to try to find.
Each periodic element is atom that has proton and neutron and electron.
Alchemist called this idea the philosopher stone or transmutation or alchemy stone etc.
In Star Trek this machine was called replicator. The idea was that replicators could take energy in form of quantum particles and stick them together into atoms and use energy to shape and form any object necessary.
I am afraid that kind of machine would require manipulation of energy worth a nuclear plant.
What we humans do on regular basis, what was called in past AL CHEMY and no is called CHEM istry. is basically using molecules and reaction patterns to form specific compounds in liquid or gas form or even solid form.
So the closest thing to magic we have today is chemistry. That is like the real harry potter thing.
The other closest thing to magic we have is dealing with atoms and that is called physics. Physics (nature from ancient root physis) is actually study of natural phenomena not man. Ergo knowing the nature.
Physics branched out into the atomic with the atomic model and then with Madam Currie into subatomic world. Hence forward people studied what is proton, neutron and electron made of.
Electrons are tiny particles with a charge opposite of proton. Neutrons are heavy and have 0 charge.
We know atoms are the building block of reality, but splitting the atom we learned there are smaller even less visible particles with tiny energies and behaviors we cannot explain.
But these quantum things are so tiny and hard to measure, because they are like feathers. They are hard to look at and observe, and hard to catch by observing instruments. And when we try to catch them like feathers they elude us, and change behavior, because they are affected by everything around them. Too tiny or too light and sensitive like a feather. They are invisible and hard to understand.
Photons are visible to us through bioelectric reactions in our eyes.
Other quantum particles are visible only implicitly through observation of matter and its behavior and our ability to theoretically explain matter.
Other ways to see sub atomic is via radiation such as heat, or radiation sickness or just plain radio waves. We also can see magnetic maps of energies.
Electricity is another good way to see sub atomic particles by inference.
Realistically we just dont know wtf atoms and quantum particles are.
We just have causal models for them.
And we can measure them.