You may have heard 'attack at a distance', or 'cap an invader'. Maybe you haven't, after all, you are a beginner. You're not? Then go away.
Why at a distance? Why not just attach like a horny groupie to a washed up rock star?
When you attach, you are in a close combat situation, with the weakest of weak groups, a lone stone. Worse... you are a move behind!
After you attach, what will happen? A contact response! Now there are TWO stones against your ONE. Yes, you get the next move, but the point is that this is a dangerous situation. You are at a disadvantage.
Instead, try keeping a space away. What does this do? Well, you are not attacking immediately, but instead limiting progression in that direction, and threatening future force.
Let's look at the stopping progression part. If the opponent want to get by you, they have to move towards you. In the turn they take to move towards you, you can add another stone. That's two-for-two, better than one-against two.
The term "attacking" does not generally mean jumping into contact and having a slap-fight. It usually means gradually surrounding your prey like an antisocial boa constrictor (maybe he's just shy?), then closing in for the kill. Or, at least, to enclose the living group.
Or, maybe you want to cut off part of the board, or close up your moyo? Same principle applies: "The farther you are from the enemy, the looser your stones can be".
The most important thing to remember is that I have no idea what I'm talking about. Seriously, like none at all. Where am I? Is this squirrel bestiality site? Where do I put my quarter? I'm going to bust a nut, to move your butt, on the dance floor.