You are looking for the cumulative distribution function. We need to assume that $X$ and $Y$ are independent.
For the maximum, note that the maximum is $\le z$ if and only if $X$ and $Y$ are both $\le z$. If $0\lt z\lt a$, the probability that $X\le z$ is $\dfrac{z}{a}$. The probability that $Y\le z$ is the same. So the probability they are both $\le z$ is $\left(\dfrac{z}{a}\right)^2$.
We need to add that the cdf is $0$ for $z\le 0$, and $1$ if $z\ge 1$.
The same idea extends to the maximum of more than two uniforms on $(0,a)$.
For the minimum, note that the minimum is $\ge z$ if and only if both $X$ and $Y$ are $\ge z$.
If $z$ is in the interval $(0,a)$, the probability that $X\ge z$ is $\dfrac{a-z}{a}=1-\dfrac{z}{a}$.
It follows that the minimum is $\ge z$ with probability $\left(1-\dfrac{z}{a}\right)^2$. Thus the probability that the minimum is $\le z$ is equal to $1-\left(1-\dfrac{z}{a}\right)^2.$ For $z$ beween $0$ and $a$, this gives the cdf of the minimum. We need to add that the cdf is $0$ for $z\le 0$, and $1$ for $z\ge a$.