They say that it is good to know all of the swear words but never actually repeat any of them. Therefore what I write is merely for your information.
¡Vete a la mierda! If you say this to a Spaniard they are not likely to talk to you again if you look like you mean it. It kind of translates as Go f+*k yourself…. definitively.
¡Hijo de la gran puta! Also very offensive a very strong way of calling someone an SOB
¡Que te den por culo! Also another expression to tell someone to go away involving a strong instruction that includes sex and travel in the same sentence
It is best to know them all however not recommended that visitors blurt them out in public unless it is amongst close friends who are the ones doing the teaching
It is true that many Spaniards in passing use words like Coño and joder but bear in mind that their tone and the context that they use them in generally give the impression that they are joking. In either case it is not seen as educated. Until you have a high level of Spanish it is probably not worth taking the risk by putting your new found swearing skills to the test. It is best to make friends first.
The funniest thing I heard was in a butchers stand in a market place in Alicante when a very serious looking german lady asked the attendant “Un kilo de polla por favor” She thought she was asking for a 1 Kg of Chicken (Pollo) In actual fact had asked for 1 Kg of Cock