It's not an overnight skill for everyone. Some people need a lot of practice. Start with uphills only since that is easiest. Angle your bike slightly to the hill and point the front wheel up hill, and use your forward foot to regulate the pressure. Keep practicing and be ready to unclip quickly when needed. Once you get better, you will be able to try harder things like flat and downhill ground.
__________________
It's like riding a bicycle