In matchplay, a coin toss decides who has the opportunity to play first off the first tee.
Subsequently if you win the previous hole you have the right to play first.
In strokeplay, the lowest score on the previous hole plays first.
In all forms of golf, once the ball is in play, furthest away from the hole plays first unless parties agree to play out of turn to save time.
Playing out of turn without agreement is as a faux pas.