I think it comes from experience, from seeing lots of infinite products you learn to write and think in terms of them, just like one of the best ways to learn to write is by reading! I'll go through a few examples and hopefully that will help.

Let's think of what a finite product such as
(1+x^2)(1+x^3))
means. Well how do you typically expand out something like this? You select one term from each bracket and multiply them, then sum up all such products! For example if I select

from the first bracket,

from the second and

from the third, then the product will be

. To expand it out fully you have to do this 2 x 2 x 2 = 8 times, for each possible selection of one term from each bracket, then add all the possible products.
A slightly trickier example: find
(1 + x + x^2 + \cdots))
. So what possible selections of a term from each bracket are there, so that the product of the two selections is

. Well a general term of the first bracket is

and a general term of the second is

where p and q are non-negative (remember p=0 represents selecting 1 from the first bracket), and so the general product is

which we want to equal

and so the coefficient of

is the number of solutions to

.
What about
(1 + x^2 + x^4 + \cdots))
? Well a general term of the first bracket is

and a general term of the second is

, so a general term of the product is

, and the coefficient of

is the number of non-negative solutions to

.
Concerning our original problem which is integer partitions, how do we write a partition of 6? Well we can write any such partition as

, where

is non-negative. For example 6 = 1+1+4, here we'd have

and all other

. Can you see how this might relate to our previous example? Here we want to write an integer n as

, previously we had

. So a natural choice here is to consider the infinite product
(1 + x^2 + x^4 + \cdots)(1 + x^3 + x^6 + \cdots))
.
Some exercises you might like to think about:
0. Can you appropriately interpret how to expand out
^n = \underbrace{(1+x)(1+x)\cdots(1+x)}_{\mbox{n times}})
to give a proof of the binomial theorem?
1. Let
)
denote the number of non-negative solutions to

. Find the generating function for the counting sequence
)
.
2. What is
(1+x^2)(1+x^4)(1+x^8)\cdots)
when expanded out? (Hint: think binary).
3. Write
\left(1 + \frac{1}{3} + \frac{1}{3^2} + \frac{1}{3^3} + \cdots\right)\left(1 + \frac{1}{5} + \frac{1}{5^2} + \frac{1}{5^3} + \cdots\right)\cdots)
in expanded form (hint: unique factorization of the positive integers), where the 2, 3, 5, etc are the prime numbers. Alter this slightly to show that

which is Euler's product for the Riemann Zeta function.
