How was dark matter formed? I am a homeschooled student in year 7. I am interested in dark matter. Specifically its formation. I am curious about when and how dark matter was first formed. Also what part it played in the formation of the first galaxies. I am aware it has something to do with haloes?
 A: The simple answer is that we don't know because we don't know what dark matter is.
We distinguish between the different kinds of stuff in the universe by their equation of state. This sound complicated, but it just describes the way the stuff behaves as the universe expands, and by dark matter we mean some kind of stuff that has the same equation of state as visible matter. Since it has the same equation of state as visible matter an obvious assumption is that dark matter is just weakly interacting matter. This is the assumption behind suggestions that dark matter might be WIMPs or axions.
If that's true it means dark matter formed at the same time as the visible matter, but actually that doesn't help much because there's no clear point at which matter formed. Most of the particles that eventually evolved into the matter we see today probably formed at the end of the inflationary era about $10^{-32}$ seconds after the Big Bang, but it's important to emphasise that we have no firm theories to describe the universe so any suggestions about exactly what happened at this time are highly speculative.
If dark matter is supersymmetric particles then dark matter became distinct from visible matter at the time of supersymmetry breaking, but again we don't know when (or even if) this happened, though to be consistent with observations it would have had to happen something like $10^{-14}$ to $10^{-12}$ seconds after the Big Bang. If dark matter is axions then they would have formed at the time of the QCD phase transition.
If you're interested in pursuing this further I recommend Phase transitions in the early and the present Universe by Boyanovsky, de Vega and Schwarz.
As to the second part of your question, we have a good idea what the universe looked like 378,000 years after the Big Bang from observations of the cosmic microwave background. The problem is that at that time the universe was remarkably homogeneous. The first galaxies formed no later than $400$ million years after the emission of the CMB, and that time simply isn't long enough for the initially homogeneous matter to have clumped into galaxies based on the observed density of matter. The suggested solution is that there is a lot more matter we can't see (the dark matter) and when we include the gravitational field of this extra matter it is sufficient to form the first galaxies so quickly.
Finally, you ask:

I am aware it has something to do with haloes?

A natural question is where all the dark matter ended up as the universe expanded and cooled. Dark matter can't form stars and planets as visible matter can because it is too weakly interacting and cannot shed its kinetic energy by radiating heat and light. So we expect that today the dark matter exists as clouds centred on galaxies, where the size of these clouds is several times bigger than the size of the galaxies. This is what is meant by the dark matter forming a halo round the galaxy. The presence of this dark matter halo is consistent with the observed rotation curves of galaxies.
A footnote: the existence of dark matter is somewhat controversial and you will find mainstream scientists who doubt that it exists. Until experiment settles the issue we just have to admit we don't know for sure. However dark matter neatly solves several unrelated issues e.g. it explains the fast formation of the first galaxies and also explains galaxy cluster dynamics and the observed rotation curves of current galaxies. While this doesn't constitute proof that dark matter exists it is certainly circumstantial evidence.
A: I will try to keep this as simple as possible and stick to the basics so you can follow along and leave anything complex to the bottom of this post. Unfortunately there are not really any simple answers.
There is actually a Total matter to Ordinary matter 'circular' symmetry, or a 'halo' type appearance of Dark matter, contained in the published results obtained from WMAP and PLANCK data but it is commonly regarded as 'numerology' by the physics community.
Considering that 'halo's and Dark matter lensing has a similar 'circular' symmetry with the objects being lensed, further analysis of one potential explanation for this 'circular' symmetry follows.
Nina Byers describes how Emmy Noether, a German Mathematician, proved Hilbert's conjecture to Klein, that Improper energy theorems not Proper energy theorems (as in Classical physics) were a characteristic feature of the general theory of relativity, in her paper "E. Noether’s Discovery of the Deep Connection Between Symmetries and Conservation Laws" in 1998.
https://arxiv.org/abs/physics/9807044v2
"Though the general theory of relativity was completed in 1915, there remained unresolved problems. In particular, the principle of local energy conservation was a vexing issue. In the general theory, energy is not conserved locally as it is in classical field theories - Newtonian gravity, electromagnetism, hydrodynamics, etc.. Energy conservation in the general theory
has been perplexing many people for decades. In the early days, Hilbert wrote about this problem as ‘the failure of the energy theorem’. In a correspondence with Klein [3], he asserted that this ‘failure’ is a characteristic feature of the general theory, and that instead of ‘proper energy theorems’ one had ‘improper energy theorems’ in such a theory. This conjecture was clarified, quantified and proved correct by Emmy Noether."
https://en.wikipedia.org/wiki/Emmy_Noether
Arthur Compton provided the final part of the puzzle on particle wave duality in his work on the particle nature of electromagnetic radiation.
https://en.wikipedia.org/wiki/Arthur_Compton
"Arthur Holly Compton (September 10, 1892 – March 15, 1962) was an American physicist who won the Nobel Prize in Physics in 1927 for his 1923 discovery of the Compton effect, which demonstrated the particle nature of electromagnetic radiation. It was a sensational discovery at the time: the wave nature of light had been well-demonstrated, but the idea that light had both wave and particle properties was not easily accepted."
The reduced Compton wavelength (a natural representation for mass on the quantum scale) and the standard Compton wavelength (conversion of mass into energy, or to the wavelengths of photons interacting with mass) are both named after him as a result.
https://en.wikipedia.org/wiki/Compton_wavelength#Relationship_between_the_reduced_and_non-reduced_Compton_wavelength
Finally the ratio of the Total matter percentages i.e. (Dark matter + Ordinary matter) divided by the (Ordinary matter percentages multiplied by 2), in both the published WMAP and PLANCK data percentages, equals Pi +/- 1.1%. As 2 is a constant the Total calculated matter/Ordinary matter ratio can equal 2 * Pi or the difference between the reduced Compton wavelength and the standard Compton wavelength as identified by Arthur Compton. 
Could you expect this 'circular' symmetry between the masses if you modelled classical Newtonian physics (Proper energy theorems) and Quantum physics (Improper energy theorems) together in the same homogeneous and isotropic universe model as used by LambdaCDM or is this just coincident 'numerology'?
The maths night be a bit advanced for you so I will provide a description of the Calculus of Improper Integrals and Proper definite integrals by change of variables with references below, should you be interested.
At a conceptual structural level improper integrals in physics can be piecewise continuous integrals, with limits from +infinity to -infinity, that converge. Refer H.J. Keisler, p367, Definition to p369, examples 7, 8, and 9. If they are continuous and don't converge then they are indefinite integrals which are entirely different. Refer H.J. Keisler, p370, example 10, diagram 6.7.10 "It is tempting to argue that the positive area to the right of the origin and the negative area to the left exactly cancel each other out so that the improper integral is zero. But this leads to a paradox... So we do not give the integral ... the value 0, instead leave it undefined."
That doesn't mean that indefinite integrals don't play a part in our physics as an indefinite integral that cycles between +infinity and -infinity at its limits, as a sub function of a higher level function, is a valid proper use of indefinite integrals as definite integrals by change of variables. Refer H.J. Keisler, p224-5, Definition and example 8, diagram 4.4.6 second equation with u and substitute infinite limits. "We do not know how to find the indefinite integrals in this example. Nevertheless the answer is 0 because on changing variables both limits of integration become the same."
A valid proper integral of any form is not equivalent to a valid improper integral because that is the underlying conceptual difference between classical and modern physics as discussed by Hilbert and Klein above.
Reference H.J.Keisler "Elementary Calculus an Infinitessimal Approach" PDF link: https://www.math.wisc.edu/~keisler/keislercalc-03-07-17.pdf
Note: The pages referred to above are the PDF pages not the page numbers in the Contents.
