关于智能合约

请问当智能合约编写完成之后,
如何调试?
如何实际部署到链上?

how can I debug and deploy after the smart contract, any tutorial about deploying and debug?

thank you