I am once again stuck on a question about geometry, this problem is about altitudes that crate right triangles:

Let there be a triangle that has side lengths of 13, 20, and 21. Given this, find the length of the altitude drawn to the side of length 21.

I have drawn the following picture to make my understanding clearer:

However, I am still not sure how to get the length of this altitude. My definition of an altitude is a segment drawn from one vertex to a point on the line opposite the point such that this segment is perpendicular to the line opposite the vertex.

I am very sure that to find the length, I will have to use the pythagorean theorem at some point, but I am not sure how to start this.

The simplest way, which will not work all the time, is that any time you see right triangles you should think about Pythagorean triples. One is $3,4,5$, which we can scale up to $12,16,20$ (note the hypotenuse of $20$ in your figure). Another is $5,12,13$. Clearly the altitude is the common figure, $12$ and the base is $5+16=21$.