How to Headphone jack replacement
How to replace headphone jack E5 play
Here’s a video that shows how to replace the screen in a Motorola Moto E5 Play.
I realize that this is not the problem but the video is useful as it shows how to open the phone so that access to the headphone jack (supplier example only) is possible. There are other suppliers online that may suit you better. Just search for Moto E5 Play (XT1921) headphone jack part to get results
At 1:35 minutes → in the video it shows how to remove the motherboard so that the headphone jack can then be removed and replaced.