In Japan, there are often taxi stands at stations, airports, large hotels, and tourist facilities. When you are in these places, go to the taxi stand and wait in line for your turn.
Moreover, in busy urban areas, taxis may be waiting on the street. If there are no taxis waiting nearby, you can hail a moving taxi. If you want to hail a taxi, go to a safe place where you can easily be seen by the taxi (for example, on the edge of the sidewalk or on the shoulder of the road in the direction you want to go), and when the taxi appears, raise your hand to signal and wait for it to approach. The red letters on the electronic signboard on the passenger side are a sign that the taxi is empty.
On the other hand, in rural areas, it is more common to call taxi companies and ask them to pick you up at your departure point. There are now taxi dispatch apps that support multiple languages, so you may want to register in advance.
Note that in Japan, taxi doors open and close automatically. Also, it is not customary to tip the driver in Japan.