initial blocks are usually used for simulation. You can use initial blocks both in test bench and main code, but initial blocks are not synthesisable; that means you cannot run that code on FPGA.
Unlike always block, initial blocks only run once in code execution. It's not necessary that you have to provide initial values to the variables. Those variables will be read as 'x' or unconnected. Or you can define those variables in the always block or in main code.
For example: y=in ? 2'b10 : 2'bzz; That is, the variable y will have value 10 if in=1, otherwise the value of y will always be zz