Finding the mode
The answer to your question is yes, usually.
I'm going to assume that you are dealing with a continuous and univariate (only one variable) distribution. You would find the mode by how you would typically find the absolute extrema of a function on some interval.
Let $f(x)$ be the probability density function. In order to find the mode, first find all values that satisfy
$$\frac{d}{dx}f(x)=0$$
if there are such values. Note that there could be more than one value that makes the derivative equal to zero, which may be the case if you are dealing with a multimodal distribution. These values are your "candidates" for the mode of the distribution.
Additionally, you have to consider the values when $\frac{d}{dx}f(x)$ is undefined. These are candidates for the mode as well.
Finally, you also have to consider the endpoints of the distribution, as these could also be candidates for the mode.
The candidate that maximizes $f(x)$ is the mode of the distribution.
Usually, the mode is when the derivative equals $0$. Some examples where this is true is the Normal distribution and the Gumbel distribution. Of course, there are exceptions, which I will mention below.
Sometimes, the derivative will never be $0$. A good example is the Exponential distribution, where the mode is always $0$, or the Pareto distribution, where the mode is the scale parameter.
Sometimes, there will be a value where the derivative is $0$, but the mode occurs at the endpoints. An example is the Beta distribution with parameters $\alpha=0.5$, $\beta=0.5$. This is a special example where there are two modes, which are at the endpoints $0$ and $1$.
Sometimes, the mode can be any value in a range. For example, the mode of the continuous uniform distribution is any value in $[a, b]$.
Finally, sometimes the derivative will never be zero, and the endpoints will also not give the mode. You would then find when $f'(x)$ is undefined. An example of such a distribution is the Laplace distribution or the Triangular distribution.
Finding the median
Finding the median is a more complicated process. Let $f(x)$ be the probability density function. Then, the median is the value $M$ where
$$\int_{-\infty}^{M}{f(x)dx} = 0.5.$$
In other words, you have to find when the cumulative distribution function equals $0.5$. This involves taking the integral of the probability density function, instead of taking the derivative.
Sometimes the integral can be done, but you may run into cases where the antiderivative is not an elementary function, and finding the median becomes much harder. For example, there's no simple closed form for the median of a Gamma distribution.
If your distribution is symmetrical though, then the median is the mean, and if the distribution is also unimodal, then the median is both the mean and the mode. In that case, you don't have to use the cumulative distribution function.