Taking audio from video

I am not sure which category to put this in so I am sorry if this post isn’t where it is supposed to be. Now on to the main question, I am wanting to know if I can take audio from one video file and use that audio to replace the audio on another video file. I have 2 copies of a Chinese movie, one of lower quality and one of higher quality, the one with lower quality has the original dialect whereas the higher quality one has another and it looks like really bad lip syncing. So I am trying to replace the audio from the higher quality video with the one from the lower quality, any advice on how it would be done?

P.S. Sorry if my grammar isn’t great, still working on it. And hopefully what I wrote is understandable.

What format are those movie files? I've done the same thing with MKVtoolnix, but both files were .mkv. Not sure if it can do that with .avi, .mp4 etc

video editing software and i think audacity.

The lower quality one is .avi and the higher quality one is .mkv, and also please let me know if the programs are free or not if you could.

MKVtoolnix should be able to do it, and it's free. You can get it at Fosshub, a link posted on the official site. It's available for most OSes.

Open the MKVtoolnix GUI, drag the .mkv in the input window and de-select the sound track of that.
Then drag the .avi in the same window and a pop-up will appear. Select "add as new input files".
At that point the video and audio track of the .avi should be added. de-select the video of it.
Then "mux" it (mux is short for multiplexing, or basically "putting it all together").
Leave MKVtoolnix open for now.

Double-click the new video file and watch the video. With some luck the audio and video are in sync, but probably not.

Go back to MKVtoolnix and click the audio track. In the window on the right, there is an option to enter a delay (in milliseconds).
If the audio is too soon, you need to enter a positive value (for example "1000" to move it 1 second). If the audio was too late, you'll need a negative value (for example "-1000")
You can also do this on the video if needed, as well as correct its size or switch it from 4:3 to 16:9, or even make it play slightly faster or slower to keep in sync with the audio.

Thank you very much for the reply and the advice. I am doing exactly as you said and it has worked but the only problem I am having now is trying to find the right timing because it is only slightly off when I delay it, and that is because the lower quality version has one added intro scene at the beginning that is like 6.5 seconds long or so. I am trying to find the exact time in milliseconds, but I am unsure how to. I thought that vlc had a way of showing it but I am unsure.