Why each lift gets three attempts
In a sanctioned powerlifting meet you get three attempts at the squat, three at the bench press, and three at the deadlift. Your best successful single in each lift counts toward your total, and the total decides placing. Three good lifts on the board, and zero good lifts in any one movement, is called bombing out: it removes you from the total entirely, which is why attempt selection is a strategy problem, not just a strength problem.
The conventional logic is opener for certainty, second for a solid personal marker, third for the reach.
Choosing opener, second, and third sensibly
A common approach sets the opener at a weight you could hit even on a flat day, often something you can move for a couple of clean reps in training, so you bank a number and settle the nerves. The second attempt is usually close to or at a recent training best, the lift you are confident you own that day. The third is where you chase a new record, informed by how the first two felt and moved.
These are general guidelines, not individual coaching. Real attempt selection should account for your training data, recovery, weight class, and a coach watching bar speed in the room.