Modal verbs in the past
English uses one word for this (could, wanted, had to). In the passato prossimo the modal verb becomes a participle (potuto, voluto, dovuto, all regular in -uto) after an auxiliary. The second verb stays in the infinitive. The passato prossimo says that it really happened: Non ho voluto mangiare means that you did not eat.
The pattern
Which auxiliary: avere or essere?
The auxiliary does not depend on the modal verb. It depends on the infinitive that follows: it is the auxiliary that this infinitive would take on its own.
With avere
The participle stays unchanged in -o.
Ho dovuto lavorare tutto il giorno.
I had to work all day.
Non ho potuto dormire.
I couldn't sleep.
Non ho voluto mangiare.
I didn't want to eat.
With essere
The participle agrees with the subject: -o, -a, -i, -e.
Non sono potuto venire ieri.
I couldn't come yesterday. (male speaker)
Maria non è voluta venire.
Maria didn't want to come.
Siamo dovuti partire presto.
We had to leave early. (male or mixed group)
In everyday speech you will also hear ho dovuto partire with avere. With the auxiliary of the infinitive you are on the safe side.