In songwriting, you can copy any idea, any trick, any technique that you hear in a song that you like. Let me be clear: copyright law prohibits copying any specific material from anyone else's song. But you can always copy a technique and express it in a different specific way. If you can separate the good qualities of a song from its specific notes and words, you can re-express them with your own original notes and words.
But, here's the catch: even if your copy is successful, even if you manage to perfectly translate another songwriter's technique into your own song, it still might not work for you.
Here's an example: One singer-songwriter's debut album included a song that was a carefully studied copy of Paul McCartney's style of gentle, acoustic love songs. As a copy, it was brilliant — it was a masterful feat of songwriting, performance, and production. But it still was the weakest track on the album. The style just didn't work for this artist.
Another example: I love the profanity-laden songs of Rancid, but when I put similarly strong language in my own songs, I almost always end up taking it out. I'm not a language prude; it just doesn't work for me the way it does for Rancid.
It sometimes may seem unfair what other songwriter can get away with. A Caribbean band writes a sunny song with a childishly simple melody and scores a big hit; but your similar song merely sounds childish. Bob Dylan rambles nonsensically and it's brilliant poetry, but your own similar efforts just sounds like gibberish. Whatever the specifics, successful songwriter-artists know their strengths and weaknesses and have learned to work with them. You'll need to take them to know yourself and tease out all of your own strengths and weaknesses.
So go ahead and study songs that you love, and learn to copy the songwriter's techniques. Just be aware that mastering the technique is only half the battle. You still have to actually make the technique work for you.