It depends on what kind of diet pills...some can be bought over the counter, but you must be 18. They often don't work anyway, they are a gimmick or make you lose just water weight. You'll gain it right back.
The way to lose weight is through healthy diet and exercise. Eat 4-6 SMALL meals a day, consisting of lean meats, whole-grain starches, fruits and vegetables. Set up your plate so 1/4 is meat, 1/4 is starch, 1/2 is fruit and veggies, and there is minimal fat.
If you do this as well as drink 8 glasses of water a day and exercise for 30 min a day a few times a week, you will see healthy results.