My lecture notes say that
A topological space is an ordered pair $(X, \tau)$, where $X$ is a set and $\tau$ is a collection of subsets of $X$ that satisfy
$X$ and $\emptyset$ belong to $\tau$.
Any finite or infinite union of the elements of $\tau$ belong to $\tau$.
Any finite intersection of the elements of $\tau$ belong to $\tau$.
The elements of $\tau$ are called open sets and $\tau$ is said to be a topology on $X$
I also know that for a metric space $(X,d)$, a set $M \subset X$ is open if for all $x \in M$, $\exists \varepsilon >0$ such that $\mathbb{B}_{\varepsilon}(x) \subset M$.
However, I am slightly confused about how the two definitions of openness match up...
Which is the more general version of openness? Is there a proof to show the more general idea of openness implies the other or to show they are equivalent?
The definition you've highlighted in your box is the more general definition. You can show that the open sets in a metric space satisfy the criteria for the general definition of "open set" (e.g. it isn't too hard to see that the union of open sets in a metric space is again an open set since unions will preserve the "wiggle room" about every point).
However, not every topology is metrizable. A topology on a set $X$ is called metrizable whenever there exists a metric $d:(X,X) \rightarrow \mathbb{R}$ whose open sets according to the "metric space" definition correspond with the open sets of the topology. Easy examples of non-metrizable spaces are certainly to be had; for instance, consider the trivial topology on any set containing more than one element, whose opens are simply $\emptyset$ and the whole space.
More interesting examples of non-metrizable spaces can be found by recognizing that metrizable spaces must be at least Hausdorff, though again one can find examples of non-metrizable Hausdorff spaces, such as the lexicographic order topology on the unit square. Determining whether a space is metrizable is, historically, a major problem in point-set topology, and much work has been dedicated to finding relevant necessary and/or sufficient conditions with results such as Urysohn's metrization theorem, the Nagata–Smirnov metrization theorem, et al.
In summary, your two definitions are equivalent when the space is metrizable. If it is not, then the second definition cannot even apply.