Digital images, whether they be photographs or scanned images, have a set number of pixels. The exact number depends on scanning settings or image sensor specifications of the camera used to take the photo. Images also have set dimensions associated with them, in effect how many inches by how many inches the image is meant to be reproduced at. By dividing the pixel count by the dimensions of the image, we can arrive at the resolution, generally referred to by the parameter ppi (pixels per inch) when referring to the digital image on a screen or dpi (dots per inch) when referring to printing a physical reproduction of the image. Without altering the actual image itself, one can adjust the effective resolution of the image by increasing or decreasing the dimensions.
Using a tool like Photoshop, it is also possible to increase the resolution and keep the same dimensions, adding pixels to the image. This is referred to as upscaling. When doing so, Photoshop will run analysis on the image and interpolate pixels based on the existing pixels in the image. This does affect the image quality and I do not advise doing this. That being said, there are a number of algorithmic options for how it goes about this interpolation, which all have pros and cons. If you must upscale an image via interpolation, testing a few different options may show that some perform better for the specific image.
For scanned items, if you have access to the original item, a much better solution would be to re-scan it at higher resolution. This way we end up with more pixels based on a capture of the actual item and not computational algorithms.
Resizing images is a simple process in Photoshop.
There are various different types of image formats, some compressed (JPG, JFIF, HEIC, PNG) and some uncompressed (DNG, TIF, NEF, CR3). In general, uncompressed file formats provide the highest image quality. Not all compression is the same, as PNG uses lossless compression compared to a format like JPG, which uses lossy compression. Without getting into the weeds of the merits of each, an important thing to note is that while you can save an image that was originally in a lossy compressed file format as an uncompressed file format (i.e. change its file type from JPG to TIF), this will not increase the image quality of the photo itself, as the compression has already occurred. Especially when working with photographed or scanned images, when at all possible it is advisable to save the original files in a lossless, uncompressed format. This will provide the highest image quality and greatest latitude when working with it later.