Set boundaries mostly by making the setup more easy for the children to stay within boundaries, reminding them to do so, praising when they do so, and (less frequently) saying "no" and/or punishing for breaking the boundaries. Be patient and consistent. It is normal for the child to be curious and test the boundaries, and for parents to set the limits.
In my experience, I found found that this works the best for boundary setting for 7 month old children (as well as for older ones, and for many other related purposes):
Determine what exactly the desired or "positive" behavior is (for example, playing next to the nappy pail but not reaching inside it). Praise the
child when you see the desired behavior in action, e.g., hug and say: "Great! You are playing with the truck, and staying away from the pail!"
Make it easy for the child to keep to the positive behavior. For example, put the nappy pail behind something else, and make it less accessible to the child. Let the child play as far away from the nappy pail as possible, for example in a different room.
Remind the child of the desired behavior before they have a chance to break the boundaries, e.g., "We are going to play here, but remember: we play with the truck, not with the nappies!"
Put less emphasis on punishment, since it is less effective
than the above methods. If you do punish, punish right after breaking the boundaries and keep the punishment short (at 7 months old more than 20 min of punishment is too long in my experience).
Ensure that all caretakers are mostly consistent about the boundaries. Otherwise, it may be confusing for the child.
Be patient and loving. Both children and adults need hundreds of gentle reminders and repetitions to learn or unlearn something.
I and others found this book to be very useful for setting boundaries and other related things:
The Everyday Parenting Toolkit: The Kazdin Method for Easy, Step-by-Step, Lasting Change for You and Your Child: Alan E. Kazdin, Carlo Rotella. It is based both on scientific research and on the rich experience of the authors.