Most guitars come with a strap button at the end. This is why the ends of the strap have a slit in them, to put them over those strap buttons. The process is a simple one if the guitar comes with such a button, and it’s a similar thing when it comes to both acoustic and electric guitars.
Most electric guitars come with a second strap button positioned on the upper side. Use the other part of the strap to attach it there. The same thing needs to be done with acoustic guitars that have a similar strap button.
However, there are acoustic models that don’t come with the second button and for those, you will need to tie the end of the strap to the end of the neck, where the strings get attached. You will have to slide the strap between the neck and the strings, tying it in a secure knot.