My sincere apologies if it came off that way.
No offense taken :)
I stay in a hostel, will I have to worry about the weed issue?
It entirely depends on the hostel. Obviously, anything near Centrum will have drugs.
Last time I went there, we rented a room in a wonderful apartment-turned-hostel next to Vondelpark. The rest of the (otherwise very respectable) building was inhabited by upper-middle class locals. The only "coffee shop" around was the bakery that sold actual coffee. It was a little more expensive (30euros per person per night) but definitely worth it. Let me know if you're planning to go so I give you the details.
What about if I have to pray on my way around the city?
I don't know much about praying, but
according to Wikipedia, you can find over 25 mosques in Amsterdam. I would try to contact the Muslim community there or the Tourism office to find out which ones would suit you best.
may I pray in a church in Amsterdam or do pastors there not allow it?
Again, I cannot be of much help here. I've never asked a Dutch priest (or any other priest for that matter) if he allows Muslims to pray in his church. I guess it depends on the priests. You could always ask; unless they're incredibly narrow-minded, I cannot imagine a priest saying no to someone looking for a sacred place to pray.
Anyway, again I want to iterate that Amsterdam is more than the stupid stereotype of drugs and prostitution. Yes, you can find them there, but that's such a tiny aspect of the culture. After all, it's the economical and political capital of a major country, with a very rich history and culture. The Dutch ruled Europe, and the world, for centuries. The people there are generally extremely welcoming, interesting and fun to be around. And bicycles, oh bicycles, everywhere.