I was wondering if it is possible to create a list of something arbitrary? I'm talking about a list at the start of the document, like a \listoffigures or a \listoftables, but not one of those two

I'm asking because I'm using a personal command \todo to display todo's in the document and it would be very handy to view a list of those todo's at the start of the document with the page of the todo next to it. Can I create a new command \listoftodos which lists all the occurences of a \todo command?
Kind regards,
Maarten