Follow the tutorial on creating a smart contract in my GitHub to set up a backend.
Initial Setup
Add a HelloWorld.sol in contracts.
Change the output directory for contracts
Add the line: contracts_build_directory: "./client/src/contracts", in truffle_config.js
Open the console $ truffle console --network goerli (or wherever the contract is to be deployed)