NOT MEDICAL ADVICE - CONSULT A DOCTOR FOR QUESTIONS ABOUT YOUR HEALTH
Losing it is far harder - the reverse conversion is lots more complicated and it appears that many individual bodies take a strong disliking towards this conversion.
As gaining weight requires little work for most people, the rest of this page will focus on losing it.
Some foods lend themselves better towards preventing storage than others. Sugars which are easily broken down are very bad in this respect. They quickly overflow your glucose storage and then cannot be used. Prime containers of 'fast sugars' are soft drinks, potatoes, candy bars and of course anything that actually tastes sweet and is not artificial sweetener.
Bread and other starch products fare much better, as do protein based foods and pasta.
Another trick is to eat when the energy stores are depleted - like in the morning, and not eat a lot when they are full (generally after dinner).
So, make sure that you are never starved. It makes no sense. In particular, this means making sure that you eat breakfast! If you ate at 7pm and then wait until 1pm before eating again, you did not eat for a staggering 18 hours! This means that you only have 6 hours to cram in all your other eating, which is sure to overflow your short term storage.
You may wonder why you don't go hungry during those 18 hours. The answer is probably a combination of ketone burning, which suppresses appetite and the fact that your body has grown used to this behaviour. Ketone burning occurs if all regular sources of glucose, which your brain needs to function, have been exhausted. It is an emergency measure.
So have some breakfast. It does not need to be a lot, but it may be, as explained above. This will let your body start up the metabolism and convinces it that it is not being starved.
You can only make this happen by making sure that your liver can perform gluconeogenesis. Gluconeogenesis enables the body to make sugar from non-sugar parts such as fat or proteins.
As stated before, this magical feat is in fact quite complicated. If you are dehydrated, as most office workers are during the day, it will not happen, leading you to go hungry while you carry large amounts of energy with you. Now, how do you get dehydrated?
Obviously by not drinking enough. But it can also happen by drinking too much coffee, which does the reverse of drinking water: it makes you excrete water. Tea is better in this respect but the absolute winner is pure water. Another thing that doesn't help is eating too much salt.