I'm starting now
How can I make a simple enemy like Mario Bros, who walks from side to side without falling off the block
This question is too broad and generic to answer.
I highly recommend you start with the official tutorial:
Some other things to read: