Suppose you have a differentiable function $f(x)$, which you want to optimize by choosing $x$. If $f(x)$ is utility or profit, then you want to choose $x$ (i.e. consumption bundle or quantity produced) to make the value of $f$ as large as possible. If $f(x)$ is a cost function, then you want to choose $x$ to make $f$ as small as possible. FOC and SOC are conditions that determine whether a solution maximizes or minimizes a given function.
At the undergrad level, what is usually the case is that you need to choose $x^*$ such that the derivative of $f$ is equal to zero:
$$f'(x^*)=0.$$
This is the FOC. The intuition for this condition is that a function attains its extremum (either maximum or minimum) when its derivative is equal to zero (see picture below). [You should be aware that there are more subtleties involved: look up terms like "interior vs corner solutions", "global vs local maximum/minimum", and "saddle point" to learn more].
However, as the picture illustrates, simply finding $x^*$ where $f'(x^*)=0$ is not enough to conclude that $x^*$ is the solution that maximizes or minimizes the objective function. In both graphs, the function attains a zero slope at $x^*$, but $x^*$ is a maximizer in the left graph, but a minimizer in the right graph.
To check whether $x^*$ is a maximizer or a minimizer, you need the SOC. The SOC for maximizer is
$$f''(x^*)<0$$
and the SOC for minimizer is
$$f''(x^*)> 0.$$
Intuitively, if $x^*$ maximizes $f$, the slope of $f$ around $x^*$ is decreasing. Take the left graph, where $x^*$ is a maximizer. We see that the slope of $f$ is positive on the left of $x^*$ and negative on the right. Thus, around the neighborhood of $x^*$, as $x$ increases, $f'(x)$ decreases. The intuition for the case of minimizer is similar.