Here are two easythree ways that do notdon't require any additional software to be installed:
As recommended by @nohillside, navigateNavigate to the image file in finder, and press space to open it with QuickLook, then text can be copied/pasted (credit to @nohillside)
As recommended by @Gilby open the image in Preview (e.g. doubleDouble click on the image file) to open it in Preview, hover the cursor over the text (the cursor will change from a cross to a text cursor), then you can drag the text cursor to select the text (credit to @Gilby).
In Photos app, hover the cursor over the text in an image and drag the text cursor to select the text (credit to @Thinkr)