While the Internet can give you almost all your answers, it is completely useless without being able to identify the right one. This is where we will start. First you must decide exactly what you want and you may have to tinker with it. i will use the example i'm trying to summon an Iron Golem that won't attack,you when you hit it. Your knowledge of Minecraft may not be extent enough to know what the problem necessarily is. You may need to search the problem online, ask a friend or use some other method of finding the problem. For me I know that the Iron Golem won't attack you if you make it. So it is assumed that there is a special data tag for this. There is a data tag for almost everything if a mob or block is special it most likely has a data tag on it. If you hit Control and the center mouse button (by defalt, you can change it pause> settings> controls> pick block and it should say 3rd mouse button by default) you will get the block you pointing at. This doesn't work with some blocks such as the dragon egg and air (of course). But it will be special because if you do it to say a chest with wood inside and place the chest it will still have wood inside, p.s. the inventory item should say +NBT Data in purple.
Anyway back on topic. If you search it online the first thing that you should see is something like /summon VillageGolem ~ ~ ~ {PlayerCreated:1}. This is a the right one but it won't always be. You might have to search around some. The command will almost always have a data tag, but sometimes it is just a different number or ID. some data tags are in parts of commands that do not recognize data tags, for these you must use square brackets [] instead of normal brackets {}.
YOU ARE READING
Minecraft Commands
General FictionThis is a book on commands by 21086@csdmail.com Comment if something needs improvement