When using for example ropsten testnet as a provider like
How do I identify the account address of my transactions?
if you're using rpc calls, most of them will have a "from" address. you have to sign them with the correct private key.
if you're using truffle (in migrations,from example) you do it like this (where xxxxx is your private key in hex, without 0x in the beginning):
var wallet = require('ethereumjs-wallet').fromPrivateKey(Buffer.from('xxxxxxxxxxxx', 'hex')) var provider = new WalletProvider(wallet, "https://mainnet.infura.io/<infura_token>");