First comes a good diet but sometimes you can hack the system by starting to train first.
My diet is the most important thing I have to fix if I want to lose weight but it is very hard to know where to start.
For most of us sports are the best way to get us going in the right direction. Important is that the sport or fitness routine is challenging enough and that it lets you see results in your performance over time. This is one major factor why crossfit is so successful, you can always improve and get better in comparison to some fitness programs without a measuring methodology twined into the program.