Perimeter mean to add all the sides so that's exactly how you would set it up.
In these type word problems I highly recommend you always draw to rectangle or whatever shape it calls for, the visuals will help.
First what you wanna do is label the width and length on the rectangle. The length is 2w+2 and the width will represented by just w. Then you would add all the sides, combine like terms and solve like any other equation. :))
Let me know if you also need help with the second one!!