You cannot. Period.
If you do not keep the aspect ratio, the image will be distorted—by definition. End of story.
To maintain the aspect ratio, you MUST crop the image accordingly, cutting off something either width-wise or height-wise.
Additionally, if you have to re-sample (re-size) the image, you will lose quality. You will be making up (inventing) pixels when you upsample, and discarding pixels when you downsample.
Elementary laws of physics.
Thank you for the feedback.