function.php parent and child

I have read up on the the function.php in both parent and child theme and that the child one is loaded first.

I have found that scripts I have been given to add to functions.php don't always work when put in the child one, but work fine in the parent one - which is not ideal as it gets lost with an upgrade or has to be redone with each theme upgrade.

I would like to get some advice and perhaps clarification about function.php when using a child theme and possibly why it doesn't work when code is added to child.