A convolution slides a small filter (kernel) over the input and computes a weighted sum at each position. The same weights are reused everywhere, which detects local patterns, such as edges, wherever they are in the image, with few parameters. The stride and the padding set the output size.
Example
nn.Conv2d(in_channels=3, out_channels=16, kernel_size=3, padding=1)