If you want to start a list item with a block of code, rather than text, you need to add at least a space character after the bullet or number, then make two line breaks before starting to indent the code block with 8 spaces.
In the following examples, line breaks are denoted by the ↵ symbol.
-
unordered
- ↵
↵
example
-
ordered
1. ↵
↵
example
Also see this answerthis answer for a real-world example.