At it's most basic level there should always be a designated impartial referee to officiate a soccer match. Even at amateur league levels the relevant governing body or soccer association will appoint a referee who has the final say on how the game is ran and the rules interpreted for that particular game.
The referee is assisted by two assistant referees, one on each touchline and in professional matches, at a high standard, by a fourth official who can also be called as a substitute referee.
The referee is the ultimate power on a soccer pitch. They have the right to award free kicks, penalty kicks, corner kicks or throw ins to either side as they feel they deserve them as well as administering the laws of the game in regard to foul play and other situations that arise during the game.
To keep order on the field the referee uses a card system with a yellow card being issued for relatively minor offences and a red card for serious offences which results in expulsion from the game.
One assistant referee is assigned one half of the field and the other the opposite half and they run up and down their respective touchlines in line with the play where they will be responsible for making offside decisions, assisting the referee in deciding which way to give throw ins, corner kicks or free kicks and generally providing an extra pair of eyes to watch for off the ball incidents and alert the referee.
The fourth official is a relatively modern phenomenon whereby the substitute referee has been given powers to enforce the off pitch areas including the team dug outs and technical areas which the managers and coaches sit and shout instructions from.
The fourth official also helps prepare substitutes for the field of play by checking their equipment and keeps another watch to record the time played. They also hold up the board highlighting how much added time is to be played after a half.
In high profile matches there may be disciplinary committees set up to investigate incidents of foul play or bad behaviour as reported by the match officials after the game.
Match officials can also be called to account if they make serious mistakes in judgement while officiating games and can lose their rights to referee or be an assistant at the higher level games.

