If someone says pudding these days they usually mean something sweet. The original definition of pudding (13th century), however, according to the OED, was "The stomach or one of the entrails (in early use sometimes the neck) of a pig, sheep, or other animal, stuffed with a mixture of minced meat, suet, oatmeal, seasoning, etc., and boiled; a kind of sausage". We do still use this sense when we say black pudding, or white pudding.
The word pudding itself is assumed to have come from the Anglo-Norman bodin or bodeyn, which meant sausage when it was singular and intestines or entrails when in the plural. The English word pudding was later (17th century) borrowed back into French.
Sausages, black pudding etc are encased in a sort of bag, so later on (16th century) the word pudding began to refer to sweet foodstuffs, too, that were boiled, steamed or baked in a bag or cloth. These sweet puddings were usually stodgy and served hot. To call any dessert, hot or cold, a pudding (British English usage - often shortened to pud) dates back only to the early decades of the 20th century. In this sense pudding began as a countable noun only - a pudding, several puddings; only later did it come to be used as a mass noun (eg What are we having for pudding?)
The OED does suggest an alternative etymology for the word pudding, this time from the Old English puduc, meaning wen or swelling. The words pod, podge and pudge would come from the same Germanic root.