If the camera cannot read the code, enlarge it, improve the lighting and avoid glare. Use the phone's Add eSIM flow and keep the full QR pattern visible.
Code on the same phone
Use the direct-install button or supported QR/image option offered by your device, display the code on another screen, or choose manual entry if installation details are supplied.
For manual entry, copy the SM-DP+ address and activation code exactly. Only enter a confirmation code if one is provided. See "Find your QR code and activation details again".
Code scans but installation fails
That is a different problem. Check whether the profile already appears in SIM settings, then see "Cellular plan cannot be added" or "This code is no longer valid" for the error you received.
Do not scan a code on another phone as a test. Keep the code private and do not post it in a public screenshot.