The canonical process for buying Bitcoin with a different currency is
The buyer uses their Bitcoin wallet to create a receiving address.
The buyer communicates this address to the seller.
For example the buyer's wallet creates a QR-code (2d barcode) from the
address and the seller scans the barcode.
The seller uses their wallet to create a draft Bitcoin transaction that
amount of Bitcoin using unspent coins from their wallet to the Bitcoin-address
provided by the buyer. This involves a cryptographic signature made by the
seller that proves they have the right to spend those coins. It also locks the
output amount with a Bitcoin script that similarly requires
the use of recipient's private-key to spend.
The seller's wallet transmits the draft transaction to a few nearby
(e.g. other wallets, etc)
Other nodes pass the draft transaction to other nodes.
Eventually the draft transaction reaches miners who each add it to their
pool of draft transactions.
Eventually one of the miners, adds that draft transaction to a block template,
usually along with a lot of other unrelated draft transactions
from their pool. The miner starts mining the block.
eventually a miner succeeds in mining a block that includes the
The miner transmits the new block to nearby nodes
Other nodes see the block is valid (matches Bitcoin's rules) and pass it on
Eventually the buyer's wallet sees the new block,
adds it to their copy of the blockchain and
adds the value to the wallet's "balance".
Over time, other unrelated blocks are added to the blockchain.
each of these subsequent blocks counts as one confirmation of the
transaction. Six confirmations is generally taken as certain.
Some people choose to accept fewer confirmations as certain.
i.e. Which block will make the transaction happen
Any subsequent valid block which contains the transaction.
and is there an automated process for it?
The first three steps described above normally involve some human interaction (but can be automated using software APIs). The remaining steps are fully automatic.