How to display a list of nodes in a block?
Unless you have a specific issue not mentioned in the question, I would recommend using a view to create this block. This would mean that the criteria remained easily editable.

If you had specific need to output the list of nodes within a custom block, or would like to pass arguments to the view from custom code you could use views_embed_view.