middle game...

What do you mean by a middle game attack?
As a general guideline, only go for an attack on the opponents King when it is justified by a significant lead in development, significantly more force near the opponent King or you see a forced mate.
Another good guideline is to only attack after you have developed all your pieces.
In other cases it is better to just look for tactics each move, if you find none, look for a startegic move that improves your own pieces, gains space etc or makes an opponent piece worse for example. If you can not find any useful move, then as a last resort, look for a move that does not make your position worse at least.
Checkmate is the ultimate goal, but to get there, you need to set many smaller goals, like improving your pieces and your position in order to gain a lead in material, like an extra pawn and then converting that to a win by promoting the extra pawn and finally checkmating your opponent.
And I trained by reading (or studying) books, doing the lessons on chess.com, doing a lot of tactics puzzles, studying annotated master games and analyzing my own games.
I am still pretty bad at chess, but I have improved a lot compared to how I played when I started.
Checked one of your games (the last one against Ser0666).
Your opponent had their Knight hanging for several moves after move 21. Finally you decided to move the pawn that was attacking the Knight instead of capturing it.
So more tactical awareness is needed.

(In my case I found that I missed a lot of exposed king forks. That discovery had immediate effect).

Good Positional Chess, Planning & Strategy Books for Beginners and Beyond...
https://www.chess.com/blog/RussBell/introduction-to-positional-chess-planning-strategy
https://www.chess.com/blog/RussBell

Check out this book: ''Simple Chess.'' You have it on YT as well: https://www.youtube.com/playlist?list=PLUrgfsyInqNbkyiwPSSBQ6ALkkccKItPE
If you are looking for a coach, I can teach you how to think in the middlegame.