tried to create a god in the a form of a being made out of magnetic field.

Over a billion years before the events of the novel, scientists worked on the creation of an disembodied intellect. The first attempt had created a powerful but insane being, the Mad Mind.

Then that creature killed all of them.
The beat the first thing by putting it in a black hole

It did not kill all of them (only a lot) before it was imprisoned in a "strange artificial star" called the "Black Sun".

but it got out by going faster than light.

The first being is still trapped, but it is hinted, that it would escape eventually.

But before they all died they made another one and this one was innocent and stuff.

The second being (Vanamonde) wascreated after the imprisonment of the first being and was created to destroy the first one, which would one day escape its prison.

and I the end of the book he beats the thing that killed everyone with friendship.

This does not happen in the novel.

