My wife is an expert on gifts and she says the biggest thing to understand is what each individual is like. It's no good me suggesting ideas for my teenage son when your teenage son is likely to be very different. So you need to find out as much as you can about them.
It sounds obvious to buy a gift that your friend or loved one will like but many people buy gifts that they think that their friend/loved one will like. This often translates into what you think they should like, which might be very different from what they actually want.
If you don't know then there are a number of things you can do to find clues.
Listen to them for verbal clues as to gifts they may like
Observe what they do, movies they watch, sports they play etc.
Look at what they already have and think of complimentary gifts
If you look at the process in these terms then you should be able to find some great gift ideas. If you're stuck you can always try my wifes site for some hints -
http://www.good-gift-guide.co.uk