To train the model to always output json, you would include Q/A pairs where the Q is in plain text and the answer is json format, and do that for hopefully, thousands of examples.
As this is such a common request the latest preview models have json mode which can be enabled to offer this as a standard feature. It’s still in development but can work extremely well .