So I can interact with a function within a smart contract. I also know that to actually do the transaction I need something like this:
const contractObj = new web3.eth.Contract(abi, contractAddress)
const transaction= await contractObj .methods.NameofTheMethod(x).send({from:myAddress,gasLimit:value})
My question is: what is the next step? Because I put myAddress but I should sign this before send the transaction right?
Otherwise how will it be able to take the fee from the gas?
You can pass the private key of the myAddress to the web3 instance using the wallet.add() method (docs). Web3 then signs the transaction before it's sent to a public node.
During local development, most node emulators (such as Ganache and Hardhat) contain private keys to the generated addresses. So in this case, the transaction is signed on the development node, and you don't need to sign it with your local web3 instance.