i brought a 15 apple gift card thinking i could buy things online just by adding it to my apple cash or wallet but i cant figure out what to exactly to do to purchase some things on websites?
What you're essentially asking to do is turn your gift card into cash. See:
The Apple Support article: Check your Apple ID balance - https://support.apple.com/HT202359 says:
"About unused Apple ID balance
You can't redeem or return Apple Gift Cards, App Store & iTunes Gift Cards, or unused Apple ID balance for cash, except as required by law. If your jurisdiction allows for refund of redeemed gift balances, you can contact Apple Support [ https://support.apple.com/contact ] to request a refund."