You can read about algorithms (as a first step, one of these):
Grokking Algorithms by Aditya Bhargava
Introduction to Algorithm by Thomas Cormen
Algorithms Unlocked by Thomas Cormen
The Algorithm Design Manual by Steven Skiena
Also, you can watch the MIT youtube course on youtube here.
And you should practice on problems on sites like leetcode or something similar. Also, there is adventOfCode that will start soon if you want to participate there 👍🏼