Polynomials in one variable over a field, like the ring of integers, are as fresh said, what is called a "principal ideal domain", i.e. every ideal in those rings is generated by one element. So in those rings all ideals are of the form "all elements divisible by some one given generator". If you jazz up to polynomials in 2 variables, suddenly you have ideals that have more than one generator. Generators of ideals are somewhat analogous to generating sets of vector subspaces, i.e. given elements u1,...,un of a ring R, the ideal they generate consists of all linear combinations r1.u1+...+rn.un for all choices r1,...,rn of elements of R.
E.g. the ideal in k[x,y] generated by x and y, consists of all polynomials in the two variables x,y such that every term is divisible by either x or y. So in a sense the concept of divisibility is central to the idea of an ideal. Every ideal has a set, possibly infinite, of generators and the ideal consists of all finite sums of elements A1,...,An such that each Aj is divisible by one of the generators. In particular all polynomial ideals except (0) are infinite since if f is one ≠ 0 element, so is x^n.f for all n. In fact the polynomial ring has the property that every ideal can be generated by a finite set of generators. Such rings are called "noetherian" after emmy noether, the author of the famous symmetry theorems in mathematical physics, although the fact that polynomial rings are noetherian is due to hilbert.
It is interesting that many ideals, but by far not all, can be described in terms of "vanishing at" a given set. E.g. the ideal generated by x and y in k[x,y] is exactly the ideal of all polynomials vanishing at the origin (0,0). However the ideal generated by x^2, xy, y^2, i.e. the "square" of that ideal, does not have such a description, although one can try to describe it as polynomials vanishing at (0,0) together with certain of their derivatives, i.e. polynomials vanishing "twice" at (0,0). There are infinitely many different ideals, generated by x^n, x^n-1.y,...,x.y^n-1, y^n, that also vanish precisely at (0,0), but with increasing "order of vanishing".
for a general theory of this topic, consult any modern book on algebraic geometry, such as Mumford's "redbook". There is a one one correspondence between all ideals of k[x,y] and all "closed affine subschemes" of the affine plane k^2. A more elementary book is Algebraic Curves by William Fulton.
Another good undergraduate book is Ideals, Varieties and Algorithms, by Cox, Little and O'Shea. In a principal ideal domain where each ideal consists of all elements divisible by some one element, one checks whether and element belongs to that ideal by dividing it by that element and seeing whether there is no remainder. In a polynomial ring of one variable this is achieved by the division algorithm. In a polynomial ring of more variables, belonging to an ideal generated by say f,g,h means deciding if an element is a sum of terms each of which is divisible by one of f,g, or h. So one needs a generalized division algorithm suited to division by more than one divisor. In modern times algorithms to decide this have been developed, based on the theory of "grobner bases" and this is discussed in the book of Cox, Little and O'Shea. this allows one to use computers to decide whether a given polynomial does or does not belong to the ideal generated by a given finite set of polynomial generators.
The geometric point of view already gives a lot of insight, since every algebraic plane curve defines an ideal of polynomials vanishing identically on that curve. But as suggested above, there are infinitely different ideals all having the same vanishing locus. If we restrict to "radical" ideals, those such that whenever a power of a polynomial belongs to the ideal then the polynomial itself already does so, there is a one one correspondence between algebraic plane curves and radical ideals of k[x,y], at least when k is an algebraically closed field. More generally, if we define the radical of an ideal as the ideal of all elements such that some power of the element belongs to the original ideal, then for k algebraically closed, two ideals I, J in k[x,y] have the same vanishing locus in k^2, if and only if they have the same radical.
So in a very real sense, ideals of k[x,y] are a generalization of the set of all plane curves. I.e. the first invariant of an ideal is what is its zero locus? that does not determine the ideal unless the ideal is radical (and k is alg closed) but it is a start.
This is a fascinating and highly complex area of study.
By the way, for rings such as Z and Z/n, there are no ideals other than subgroups, so the concept is not so new there, but considering subgroups as ideals can still give rise to new insights.