creating OP_RETURN script on bitcoin core console. i.e. with the help of commands I want to create a OP_RETURN script on bitcoin core console. Not using GUI, i.e. available on proofofexistence.com , Just as we create raw transaction and then sign it and then broadcast it, I am curious about how to create OP_RETURN script. Anyone here can give reference or want to share their knowledge? Step by step explanation would be much appreciated.
createrawtransaction has an option for data. That will create an OP_RETURN output with whatever hex-encoded data you want in it. So you would have a createrawtransaction command that looks something like this:

createrawtransaction '[]' '{"data":"deadbeef"}'