If the person who gave it to you got it from Amazon just recently they have until the end of January to return or exchange it.
If you try different cables and chargers that you know are good and it still doesn't charge, there is probably nothing you can do to "fix" it.
And I'll go ahead and state the obvious, read the instructions to make sure you aren't missing anything.