So usually in ASP.NET Core MVC we would create a dedicated action method that's only job is to return the image.
public ActionResult ProductImage(int id)
{
var fileInfo = //get this object from the database based on the id, looks like you already know how
return File(fileInfo.TheByteArray, fileInfo.MimeType);
}
In the above code, I'm assuming you've got an object called fileInfo that contains the byte array representing the image, and the MIME type of the image (if you've only got the file extension, you could just implement a method to convert from the extension to a MIME type). You will likely have different property names, adjust your code accordingly. This action method is going to write the image directly to the response, with the MIME type passed as the content type.
By hitting this URL for image, you should be able to see the image in your browser. Then the only remaining step is to set the image element in your Razor page to point to this location. I'll assume your model has FileId property that represents the file you want the user to see.
<img src="/MyController/ProductImage/@Model.FileId" />
Note that getting an image from the server and returning it every time they hit this page might not be super efficient, so you might look into various caching options.