Sadly, code can not be written in a Microsoft Word document. Well… I guess it can, but if you do, the full force of Reddit will come personally to your house and put you out of your misery.
You could write your code in a text editor or in an integrated developer environment (IDE). While a text editor offers some useful tools like syntax highlighting and automatic indentation, an IDE typically has a lot more features (including really good tools to help you find errors in your code).
When you just get started, you want to go straight to the code, without spending hours configuring your environment. A text editor that is easy to use, but that can be customized with excellent tools is perfect in these cases.
A good editor to start with is Atom. After installing it, you can start coding right away. As you develop, you might find yourself in need of some extra features to improve your productivity. For such cases, atom can be extended with various plugins. If you want to customise atom further, see this video.
Another simple editor is Sublime. Although there are various differences between Sublime and Atom, but starting with either is fine. Here is a quick guide for running Sublime. For a detailed side-by-side comparison of the two editors, see here.
Once you have a reached a certain level in developing programs and software, you might want to upgrade to an integrated developer environment (IDE). IDEs typically have features that will help you develop back-end servers, Android apps, and use SQL queries and data visualisation more easily.
The JetBrains include IDEs for professional or advanced programmers, and cover many different languages (including Java, C/C++, Python). JetBrains normally requires you to pay for to access all the features of the IDEs. However, if you are a student, you will be able to access them for free, as part of their education initiative here.