The Bible says we should covet earnestly the best spiritual gifts (1 Corinthians 12:31). How do various denominations recommend obtaining spiritual gifts?
Ask God. So I say to you: Ask and it will be given to you; seek and you will find; knock and the door will be opened to you. For everyone who asks receives; he who seeks finds; and to him who knocks, the door will be opened. Luke 11:9-10
The spiritual gifts are gifts of the Holy Spirit. Indwelling of the Holy Spirit is something one asks God for. And gifts have a purpose and direction in ministry. By pursuing needs one finds God provides an answer.
All evangelical denominations have versions of this, some emphasising the more attribute gifts, of love, patience, endurance, joy, peace, while others say gifts of healing, prophecy, speaking in tongues is important.
All focus on dwelling more in God, in scripture, in seeking to help others. Some emphasis holiness, and purity, while others listening to the right preachers and teaching.
In my denomination (Free Methodist), you don't "obtain" a gift; you discover the gifts you've been given. Our pastors have a variety of questionnaire-style resources that can help guide a person in making this discovery. Sometimes all it takes is for the people close to you to see you about your normal activities in the church.
The biblical basis for this position is earlier in the chapter where the verse you cited appears:
There are different kinds of gifts, but the same Spirit distributes them. [...] All these are the work of one and the same Spirit, and he distributes them to each one, just as he determines.
-- 1 Corinthians 12:4, 11
So looking at the fuller context of verse 31, it's pretty clear that there's no "method" or "formula" for obtaining a gift. If the Spirit wants you to have it, He will give it to you. If He doesn't, He won't.
If you look at the Corinthian letter in which the spiritual gifts are described, you will see that the Corinthian church at the time where in quite a bit of a mess. As such we can surmise that having a spiritual gift is definitely NOT the pinnacle of spirituality!
As @JDM-GBG states, the gifts all come from the same spirit. However in Ephesians 1:3 it states that the Ephesian church (and the faithful) are blessed with "every spiritual blessing". So which is it, do we have all of them, or some but not others? How do we find out?
The best way to think of this is that when we are born again, we are like a brand new spiritual baby entering into the world. We have all the muscles, tendons, bones that we need in order to walk, run, skip, a variety of different things. However, we can't immediately function in every aspect like an athlete would.
So there is a process of learning and growing that is required in order to function in any kind of spiritual faculty. And this requires faith.
When a baby tries to walk for the first time, it's pretty much guaranteed that they'll fall over. But they need to build up strength and coordination and this only develops as they try over and over again. Imagine if they didn't have faith that they could walk? Imagine if everyone around them kept telling them that it wasn't possible?
It's the same with the spiritual 'giftings'. There are things that we can do now because we are spiritual beings - in partnership with the Holy Spirit. However it's going to take faith, practice and perseverance. If you were gifted however, you may find that you find something quite a bit easier initially. It's still up to you whether you develop it. (Compare a gifted piano player who never practices and an ordinary everyday person who practices the piano every day for 10 years...)
The reason that spiritual gift surveys appear to work - is that they really only ask what areas you've practiced in and/or had some success in so far. Look instead at Jesus. He demonstrated most of the spiritual 'gifts' and he is our example of what a mature spiritual person looks like.
So to summarize, you should aim to meet the needs of whatever person is in front of you in partnership with the Holy Spirit. You'll more than likely find that it's hard work and embarrassing as you develop. However it's not supposed to be hard, and you have been built to succeed. You have everything you need.
Be honest and wise about it. If you want to prophesy - tell people that you're just starting and you 'think' that this is a word for them and that they should test it - even if it's just one word. If you want to heal - then just start praying for people, declaring God's will that they should be healthy. Grow & develop. Join a group, or meet with people that do these things so that you can get some encouragement and advice and practice in a safe environment.
But if you don't take that step out in faith, you'll never discover you can walk, let alone run!