Both images have fairly noticeable color casts. The first image leans a little more towards green, while the second leans more towards magenta.
To get the first image to look more like the second, adjust white balance correction away from green and towards magenta and also maybe move amber towards blue just a tad.
They are taken in JPG. I haven't done any post-processing in the photo I posted. I'm new to photography.
You have a couple of choices here.
You can continue to shoot straight to JPEG if you're willing to get out of "Auto" white balance. Keep in mind that WB is more than just color temperature along the blue ←→ amber axis. It's also adjustment along the magenta ←→ green axis that is more or less orthogonal to the CT axis.
You can set a specific CT and WB correction, or you can set a Custom WB. Your camera's Instruction Manual or User's Manual should tell you how to set a custom WB. The advantage of manually setting CT and WB correction or using a Custom WB is that you will get the same WB from frame to frame. The biggest disadvantage of doing it this way is that your camera's LCD screen isn't calibrated and the light you're viewing it under, which influences how you perceive the color on the screen, isn't standardized. So what looks good on the back of your camera when you're shooting might not look the same when you later look at it in your computer's monitor, particularly if the light you're shooting under has a heavy cast.
Your other option is to save the raw data and do color correction on a calibrated monitor as part of your raw conversion process. Yes, there's a steep learning curve to getting started using raw processing applications. But the flexibility¹ and the benefits you get from saving the raw data are well worth it.
The problem with using Auto WB in camera is that every time the contents of the scene as you frame it changes, the algorithm that sets the WB can change what it thinks is "correct". Even if nothing in the scene and the light illuminating it changes, just moving the camera to change what is and what is not inside the frame will influence Auto WB to one degree or another.
¹ Although buried in the answers to the question linked above because it was nine years late to the party (at a time after most active users at Photo SE had became bored with the same few questions being endlessly repeated ad nauseum and stopped participating in the community) and very few folks have even looked at it, this answer shows several different examples of how processing raw files leads to better results when shooting in difficult lighting.