Both exercises have their own set of benefits, but which exercise is best depends on your goal.
If you are a beginner, then you should squat. Squats don’t require proper balance, which is the reason why they are easier to perform. You can start this exercise with just your body weight (no weights) and then move on to some weights like dumbbells or plates.