I'm trying to understand how Dynkin diagrams work but I'm struggling quite hard.
For example I want to find the Dynkin basis of the weight space. I know that the weight space is the dual space of the root space and that if we take as basis of the root space $\mathcal{B} = \{2\alpha^{(i)}/(\alpha^{(i)}, \alpha^{(i)})\}$ where $\alpha^{(i)}$ are the simple roots. Now the weight space consists of linear maps $\Lambda_{(i)}$ with $\Lambda_{(i)}\left(\frac{2\alpha^{(j)}}{(\alpha^{(j)}, \alpha^{(j)})}\right) = \delta^j_i.$ These are the fundamental weights and form the Dynkin basis of the weight space: $\mathcal{B}^* = \{\Lambda_{(i)} \vert i = 1, \dots, r\}$ where $r$ is the rank of the algebra.
Now I know we can relate the Dynkin diagrams to the Dynkin basis, but I don't really udnerstand how. For example, I want to do this for $G_2$, but I don't know where to start. It seems too much work to first compute all the simple roots...
I am not completely sure where exactly you have difficulties. Maybe an example can help.
How Cartan matrices and root systems can be retrieved from the Dynkin diagram on the example of $G_2\,.$
The Dynkin diagram tells us that $\alpha \prec \beta$ and $\langle \alpha,\beta \rangle \langle \beta ,\alpha \rangle=3\,.$ The cosine formula tells us, that the angle they enclose is $30°$ but this doesn't matter here. Since the only ways to get an integer product of three are $3\cdot 1 = (-3)\cdot (-1)=3$ we may assume w.l.o.g. and the sign in the theorem of root systems in mind, that $\langle \alpha,\beta\rangle = -1$ and $\langle \beta,\alpha\rangle=-3\,.$ This produces the Cartan matrix $$ G_2\, : \,\begin{bmatrix}2&-1\\-3&2\end{bmatrix} $$ Next we calculate by linearity in the first argument \begin{align*} \alpha - \langle \alpha,\beta\rangle\cdot \beta &= \alpha+\beta \\ \beta - \langle \beta,\alpha \rangle \cdot \alpha &= 3\alpha+\beta \\ (\alpha+\beta)-\langle \alpha+\beta,\alpha\rangle\cdot \alpha &=2\alpha+\beta \\ (3\alpha+\beta)-\langle3\alpha+\beta,\beta \rangle\cdot \beta&=3\alpha+2\beta \end{align*} From the decomposition formula $$ \mathfrak{g} = \mathfrak{h}\oplus \sum_{\alpha \in\Phi^+} \mathbb{F}E_\alpha \oplus \sum_{\alpha \in\Phi^-} \mathbb{F}E_\alpha $$ we get with a two dimensional Cartan subalgebra $\mathfrak{h}=\operatorname{span}\{\,H_\alpha,H_\beta\,\}$ the roots \begin{align*} \Phi^+ &= \{\,\alpha,\beta,\alpha+\beta,2\alpha+\beta,3\alpha+\beta,3\alpha+2\beta\,\}\\ \Phi^- &= \{\,-\alpha,-\beta,-\alpha-\beta,-2\alpha-\beta,-3\alpha-\beta,-3\alpha-2\beta\,\}\\ \end{align*} and $$ G_2 = \operatorname{span}\{\,H_\alpha,H_\beta\,\} \oplus \sum_{\gamma \in \Phi^+\,\cup\, \Phi^-} \mathbb{F}\cdot E_\gamma $$
If you want to create the weight spaces of arbitrary finite-dimensional representations other than the adjoint, you could look e.g. at the proof of theorem 7.2 for the other simple case $\mathfrak{sl}(2)$ in Humphreys's book about Lie algebras and their representations, GTM 9. But I am sure that this example can be found easily on other sources.