Just like any other skill you have to give it time.
Try to code at least five days a week for a minimum of thirty minutes.
This will develop the skills and soon make it effortless.
I would advise that you take a short course, learning in a structured way with an instructor is easier than going into the abyss of too much information which the internet is. (I did Udemy's Data analysis with R on Coursera while starting out).
Reading a book comes second to this.
Above all is practicing, doing a real project. You can get this by offering pro bono data analysis to young researchers or assisting established analysts.