An example should be something like this: $10 ⟶ ¥10000 ⟶ €5 ⟶ $12 (profit)
This is called triangular arbitrage. The concept is simple and well-known. The process is not risk-free. There are many potential execution pitfalls. Even if you manage to identify a profitable cycle, the prices could change before you manage to complete the cycle. Your example involves three trades (USD → JPY; JPY → EUR; EUR → USD). During the execution of the first trade, the prices of currency pairs in the second and third trades may move in such a way that makes the entire cycle unprofitable. For these reasons (and many others), retail investors may not be able to make any money from triangular arbitrage.
Since you appear to be a programmer, you may be interested to know that the Bellman-Ford algorithm can be used to quickly check whether or not a profitable arbitrage cycle exists, and if so, find one of the cycles. The detection of arbitrage cycles is one of the applications of shortest path algorithms, and this use is mentioned in popular algorithms textbooks such as Algorithms by Sedgewick and Wayne (see § 4.4 Shortest Paths), and Introduction to Algorithms by CLRS (see Problem 24-3 "Arbitrage").
The Bellman-Ford algorithm only finds one cycle. To get the list of all profitable cycles, a simple depth-first search (DFS) should suffice (the inefficiency of DFS may not matter if you are only involving a small number of currency pairs). This is an interesting exercise in implementing graph algorithms, but don't expect to make any money from your implementation!