CoinJoin
In a CoinJoin, many people build one transaction together. Each brings inputs and receives outputs of the same standard amount. From the outside, all equal outputs look alike: an observer cannot tell which output belongs to which input. Each participant signs only their own inputs, so nobody can steal from the others.
Most CoinJoins use a coordinator to gather participants. The coordinator cannot take funds but sees some metadata, and coordinators have faced legal pressure: some well known services shut down in 2024. Some exchanges also refuse coins with a CoinJoin in their recent history.
PayJoin
PayJoin is quieter. When you pay someone, the receiver also adds one of their own inputs to the transaction. It looks like an ordinary payment, but the common input ownership heuristic now gives a wrong answer, and the amount really paid is hidden. Both wallets must support it.