'This is an 'Indirect Statement' - an incredibly common language construction necessary to understand for Latin GCSE. An indirect statement is a reported version of an action or event.
An example of this in English is: They said that they would arrive tomorrow
It is expressed using the accusative and the infinitive. To recognise an Indirect statement you need to look for an infinitive at the end of a sentence as well as a 'VAN' verb. A 'Verb above the neck' is a hear'say verb such as 'think', 'know', 'say' or 'tell'.
To translate:
Translate the main clause which includes the 'VAN' verb'
Add in the work THAT in English (not included in the Latin)
Add the first noun which will be in the ACCUSATIVE Case
Go to the INFINITIVE and translate according to tense but also voice (sequence of tenses)
In this case 'Servi subito senserunt se in maximo periculo esse' would be translated as 'The slaves suddenly realised that they were in the greatest danger.
'Servi subito senserunt' is the main clause
'Se' the reflexive pronoun in the accusative
'Esse' infinitive present active of sum