The computer vision problem that you are describing is object detection, i.e. the problem of finding the location of specific objects in an image and label them correctly with their names.
There are many resources on the web (or in books) that describe this problem more in detail and examples (which also include code) to get you started with it (e.g. this one).
In any case, to solve this problem, you will (probably) need a labelled dataset $D$. So, if you don't have it, you will need to (manually) collect many images, similar to the ones you describe, and find the objects of interest in them (i.e. their locations, which may be specified as a bounding box), and assign the corresponding name to each of them. At the end of this process, you should have a dataset of the form $D = \{(x_1, y_1), \dots, (x_1, y_1) \}$, where $N$ should be as big as possible, $x_i$ is an image, and $y_i$ are the labels (also known as targets), which, in this case, should be both the location and name of all objects of interest in $x_i$. The specific format of the labels depends also on the specific model that you will train to solve this problem. You can find different models online for this task, such as YOLO.