The three control statements
BEGIN (or START TRANSACTION) opens a transaction. COMMIT finalises it — every change becomes visible to other sessions and is durable on disk. ROLLBACK throws everything away. These are the only three transaction control statements you'll write 99% of the time.
Application-side patterns
Every database driver wraps these. In Python with psycopg: conn.commit() / conn.rollback(). In SQLAlchemy: a session commit() or context manager. In Node with pg: client.query('COMMIT') / client.query('ROLLBACK'). The semantics are identical; the syntax wraps it.
Always handle the failure case
The typical bug: BEGIN, run statements, COMMIT — but if any statement raised an exception, the transaction is left open and idle. The next statement on that connection errors with "current transaction is aborted." Always roll back on exception.