There are several ways to obtain trial codes for Xbox Live's Gold subscription, and the easiest way to get a free trial for the service is to make a new gamertag, Xbox's online handle. That grants the user a free 30-day trial to the program.
Many Xbox 360 games come with cardboard inserts with prepaid codes printed on them. These codes can also be redeemed for Xbox Live subscription time. The amount of time on each one varies, however. Older games may have 30-day trials, while newer releases usually have much shorter, two-day trials. The number of gamertags a user can make is unlimited, so this option is usually the best. A user's game progress and achievement points do not carry over, so it is not a very efficient long-term solution.