If expr1 is not NULL, IFNULL() returns expr1; otherwise it returns
expr2.
And then lots of examples. This is equivalent to using a ternary conditional with a comparison to NULL and the comparison subject as the second operand; that it doesn't happen to use the symbols ? and : to get you there is not really relevant to anything.
So, in your case:
SELECT IFNULL(`id`, 0) FROM `table`
If you're desperate to provide three operands explicitly (why?!), then switch to IF: