When it comes to photography, professionals don't technically sell their photos. Instead, they grant licenses to customers that allow them to share images online and in person. This license agreement can be used in a variety of ways, depending on the customer's needs. For example, if you're looking for a wedding photographer, you may want to discuss the possibility of receiving all the RAW files from the shoot.
This way, you can take full ownership of all the photos you commissioned. However, it's important to understand that photographers are asked this question a lot and may get annoyed over time. Many professionals choose to retain the photographer's rights to the photos in order to add them to their portfolio and help their business grow. It's also important to remember that you're paying for the experience provided by the photographer, often many years of experience, to develop the eye for detail, the lighting, and to perfectly frame a scene or capture one of those moments that seem so easy and obvious once captured, but extremely difficult to capture well.
When selecting a photographer, it's important to read through the contract carefully before signing it. Most contracts indicate that you pay for the photographer and that, contractually, nothing other than the photographer's presence and camera are promised. You should also discuss with your photographer before the project starts if you need all the RAW files from the shoot. At the end of the day, it's important to remember that each photographer creates their own expression of art through their own work.
Give the same camera, light and subject to a group of photographers and each one will get a very different photograph. So make sure you choose a photographer who knows and values the work of shooting with quality and unaffected.