absitzen
to serve
To serve a prison sentence.
Er musste eine Haftstrafe von drei Jahren absitzen.
He had to serve a three-year prison sentence.

to serve / to sit out / to dismount
Loading your saved state.
to serve
To serve a prison sentence.
Er musste eine Haftstrafe von drei Jahren absitzen.
He had to serve a three-year prison sentence.

'Absitzen' is a separable verb. The prefix 'ab' goes to the end in a main clause. In subordinate clauses, the verb stays together, and in the infinitive with 'zu', 'zu' goes in the middle.
Er saß seine Strafe bis zum letzten Tag ab.
He served his sentence until the very last day.
The object of the sentence reveals the meaning. 'Eine Strafe' (a sentence/punishment) or 'Jahre' (years) with 'absitzen' means serving a prison sentence. 'Die Zeit' (the time) or 'Stunden' (hours) with 'absitzen' means waiting in a bored way. Without an object or with 'von' (e.g. 'vom Pferd'—from the horse), it means to dismount.
Er musste zwei Jahre im Gefängnis absitzen.
He had to serve two years in prison.
In the meaning 'to serve a sentence', the verb is almost always used with an accusative object that names the type or length of the sentence. Typical phrases are 'eine Haftstrafe absitzen' (to serve a prison sentence) or 'eine Gefängnisstrafe absitzen' (to serve a jail/prison sentence).
Wegen des Betrugs musste der Manager eine lange Haftstrafe absitzen.
Because of the fraud, the manager had to serve a long prison sentence.
When 'absitzen' means 'absteigen' (to dismount / to get off), it is often used with the preposition 'von' and the dative to say what someone is getting off. But it can also stand without this addition.
Die Radfahrer saßen von ihren Rädern ab, um eine Pause zu machen.
The cyclists got off their bikes to take a break.
to sit
'sitzen' and 'absitzen' can both mean that someone is serving a prison sentence. 'sitzen' is colloquial and often shorter: for example, you say that someone 'sitzt im Gefängnis' (is in prison). 'absitzen' puts more emphasis on the sentence or the length of time that someone has to spend in full. It sounds more precise when talking about a judgment or a specific period of time. Learners may confuse the words because both occur in the prison context. As a simple guide: 'im Gefängnis sitzen' describes the state, while 'eine Strafe absitzen' (to serve a sentence) describes serving that sentence.

Nach dem Urteil muss er noch sechs Monate absitzen.
After the judgment, he still has to serve six months.
Der Mann sitzt seit zwei Jahren im Gefängnis.
The man has been in prison for two years.