The leg extension is an isolation exercise for the quadriceps. It allows you to work all four heads of the quadriceps muscle in isolation from other muscles, leading to much more quad activation.
However, the leg extension has some really big drawbacks compared to squats or leg presses. Since its an isolation exercise that only targets one muscle, and especially focuses one head of the quadriceps. This exercise neglects many smaller muscles that need to work together to stabilize your body. Weak stabilizers result in a higher risk of injury, especially knee injuries. And it will give you very little carryover to other movements and exercises, because most movements are done with synchronization of many muscle groups, and you're only as strong as your weakest link.
Despite the downsides, the leg press is a relatively simple exercise. The movement is limited by the machine, so there is little chance you'll hurt yourself using the wrong form. So the leg press might be a better option for beginners, if you don't have the correct squat form yet.
Watch your knees. This exercise might put a lot of stress on the knee joints. Advice a doctor or a professional trainer if you had former knee problems, and don't continue this exercise if you feel knee pains. Make sure to incorporate hamstring strengthening exercises. When the quadriceps are much stronger than the hamstrings you knees looses stability and becomes more susceptible to injury.
Move the legs in a slow and controlled manner. Avoid dropping the weight fast, but lower it slowly. This will give you greater activation of the muscle and prevent you from using momentum.