You put your own reputation on the line when you write a letter of recommendation. If you feel you do not know the person well enough, or they are somebody you cannot in good conscience recommend, decline their request.
Familiarize yourself with the position. Get a copy of the job description, if you can, and talk to the person you will recommend. If you know the intended recipient of the letter, ask them about the position as well. The more you know about the position, the better you will be able to tailor your letter to suit the needs of both parties.