Given categories $\mathsf{C},\mathsf{D},\mathsf{E}$ with functors $F:\mathsf{D}\to\mathsf{C}$ and $G:\mathsf{E}\to\mathsf{C}$, the comma category $F\downarrow G$ is defined as the category
whose objects are triples of the form $(d,e,f)$ where $d\in\mathsf{D}$ and $e\in\mathsf{E}$ are objects and $f:Fd\to Ge$ is a morphism of $\mathsf{C}$; and
whose morphisms are tuples $(h,k):(d,e,f)\to (d',e',f')$ such that $Fh:Fd\to Fd'$ and $Gk:Ge\to Ge'$ are morphisms in $\mathsf{C}$ such that the following square commutes:
The functors $F$ and $G$ can be thought of as "translating" elements of $\mathsf{D}$ and $\mathsf{E}$ into the "common language" of $\mathsf{C}$ so that morphisms can be found between them. Here's another way of visualizing how morphisms $(h,k)$ interact with objects $(d,e,f)$ of the comma category:
Notice that the slice categories can be constructed as special cases of the comma category. In particular, if $\mathbf{1}$ denotes the discrete category with one object, we have that:
If we take $\mathsf{D}=\mathbf{1}$ and $\mathsf{C}=\mathsf{E}$ and let $\text{id}:\mathsf{E}\to\mathsf{C}$ be the identity functor and $T_c:\mathsf{D}\to\mathsf{C}$ be the functor taking the unique object of $\mathsf{D}$ to $c\in\mathsf{C}$, then we have that $c/\mathsf{C}$ has the same structure as $T_c\downarrow \text{id}$.
If we take $\mathsf{E}=\mathbf{1}$ and $\mathsf{C}=\mathsf{D}$ and let $\text{id}:\mathsf{D}\to\mathsf{C}$ be the identity functor and $T_c:\mathsf{E}\to\mathsf{C}$ be the functor taking the unique object of $\mathsf{E}$ to $c\in\mathsf{C}$, then we have that $\mathsf{C}/c$ has the same structure as $\text{id}\downarrow T_c$.
The above graphic can be modified to show the slice categories as a special case of the comma category: