The giftcard must be tied to the platform where you are purchasing it. If you have a generic Best Buy gift card and want to use it to get a PS4 game from the PlayStation store, for example, you just need to go to Best Buy and use their gift card to purchase the specific gift card for that platform - a PlayStation gift card in my example.
Gift cards for specific stores will always come with instructions on how to redeem them. Typically you have to access their online store on your device and look for "redeem code" or something similar to that.