A typo in ~/.tmux.conf shows up as an error the next time the server starts, which is the wrong moment to find it. You can test the file first.
tmux source-file -n ~/.tmux.conf
With -n, tmux parses the file but runs none of the commands. If it finds a problem it prints the file name, the line number and what is wrong, and the exit status is 1. A clean file prints nothing and returns 0.
A test file with a made up command gives something like this:
/home/me/.tmux.conf:2: unknown command: foo-bar
Add -v to also see each parsed command with its line number. Because of the exit status it fits nicely in a reload binding or a script, so that a broken file never gets sourced:
tmux source-file -n ~/.tmux.conf && tmux source-file ~/.tmux.conf
It is a parse check, not a full test. Wrong option values or a binding to something that fails at run time can still pass. Like most tmux commands it talks to the running server, so I’d run it from inside a tmux pane.
Further reading: tmux manual page (OpenBSD)