I write a game using SFML libraries, however, when I run the game on another PC, it requires this library. I read somewhere that you can pack library files with the game executable, but I don’t understand how to do this. Please tell me the correct ways to solve this problem.
"the right way" is usually to keep the dll and program distinct so you can issue smaller updates to your program or update the dlls with more control. Pushing a gigantic executable to many clients is a giant strain on your server for a popular game if it was not necessary.
for a beginner, though, keeping it all in one big program is fine and easier to manage.
as you get better, you will want to use tools that manage this for you -- see online for 'making an installer'. All an update is, is a partial installer with the parts that did not change removed.