Here is an elaboration of the comment I gave. In the category of CW complexes (and in more generality), there several important functors which are representable.
If for a space $X$, and $G$ a topological group, we let $P_G(X)$ denote the isomorphism classes of principle $G$ bundles, then $P_G(X) = Map_{HTPY}(X,BG)$. The space $BG$ is called a classifying space. Such spaces are the base of a universal $G$ bundle, $G \to EG \to BG$, with $EG$ contractible, and are unique with this property. $EG \to BG$ is the Yoneda element, so that a principle $G$ bundle on $X$ is obtained by pulling back $EG \to BG$ along the map $X \to BG$.(The homotopy class of $X \to BG$ is called the classifying map of the vector bundle that inuced it.)
In the case when $G = SU_n$, $B(SU_n)$ is the infinite complex Grassmannian of $n$ planes. By using the Leray spectral sequence with the fibration $SU_n \to E(SU_n) \to B(SU_n)$, or the Leray-Hirsch theorem (see Hatcher 4.D), the cohomology ring of $B(SU_n)$ can be computed and shown to be $\mathbb{Z}[c_1, c_2, \ldots, c_n]$, where $deg(c_i) = 2i$. Thus, for a vector bundle $V \to X$, we get a map $f : X \to V$, well defined up to homotopy, and we can associate to $V$ cohomology classes $f^*(c_i)$. This is one way to define the Chern classes of $V$, which are useful and natural invariants of a vector bundle.
(As you probably know, Chern classes appear also in algebraic geometry, but inside the Chow ring, not cohomology. There is a fancy way to repeat this construction using a stack that classifies algebraic vector bundles, and somehow you can do intersection theory on it - but I don't really know anything about this yet.)
This point of view on principle $G$ bundles can be used to analyze questions about reduction of the structure group, by phrasing them as factoring the classifying map through other classifying spaces.
For an excellent introduction to some of these concepts, I would like to suggest these notes: https://www3.nd.edu/~mbehren1/18.906/prin.pdf
Another important case of spaces that represent functors are the Eilenberg-Maclane spaces. $K(G,n)$ is the space with only one nontrivial homotopy group, specfically $\pi_i(K(G,n),*) = G$ if $i= n$ and is zero otherwise. These spaces are unique up to homotopy equivalence, and it is shown in section 4.3 of Hatcher that pointed homotopy classes from $X$ to $K(G,n)$ represent the functor $H^n(X,G)$.
In some cases, the two constructions above coincide, for example $B(\mathbb{Z}) = S^1 = K(Z,1)$ and $B(S^1) = \mathbb{CP}^{\infty} = K(Z,2)$. In fact for any discrete group $\Gamma$, $B(\Gamma) = K(\Gamma,1)$, since is principle $G$ bundle with $G$ discrete is the same thing as a regular cover with deck group $G$.
From this we get that $B(O(1)) = K(Z, F_2)$, so a real line bundle on the circle $S^1$ is the same thing as a cohomology class $H^1(S^1, F_2) = F_2$, and in particular there are exactly 2 (topological isomoprhism) classes of line bundles on the circle, the cylinder and the Mobius band. This is a very concrete application, but there are presumably simpler ways to show this.
In a similar way, one can show that the set of isomorphism classes of complex line bundles on the sphere is $\mathbb{Z}$, and the various additions coincide (tensor product, cohomology classes, $H$-space stucture on $\mathbb{CP}^{\infty}$).
For more on this, there is : http://math.ucr.edu/home/baez/calgary/BG.html
Using the existence of maps between Eilenberg Maclane spaces, which correspond to cohomology classes of these Eilnerbeg Maclane spaces, one can define natural transformations between various cohomology functors. This leads to the topic of cohomology operations.
Obstruction theory, which answers questions about when maps can be lifted or extended, can also be phrased and answered using generalities about Eilenberg-Maclane spaces.
Besides the links already given, chapter 4 in Hatcher's Algebraic Topology is a great reference for this material. (I've been reading it recently.)
--
Let me also outline an example from algebraic geometry.
If $X$ is a projective variety, we could be interested in understanding flat families of subvarieties. For example, we may be interested in understanding families of points on a surface. In order to take into account how and when the points in a family may collide, it ends up being convenient to study families of 0-dimensional subschemes of $X$ instead. There is a scheme that classifies such families, and it is called the Hilbert scheme of points. More precisely, maps from $B$ to $S$ correspond to closed subschemes of $B \times S$ that are flat over $B$ and whose fibers are $0$ dimensional.
https://en.wikipedia.org/wiki/Hilbert_scheme
Like in the topological examples, you can presumably do stuff with families of poitns using the geometry of the Hilbert scheme. I don't know any examples though.
I think studying the topological story is a good way to gain familiarity with these kinds of ideas, before learning the additional complexities in algebraic geometry. That's what I'm doing anyway.
I hope this helps!