I'm struggling with syncopation switching between going off and back on beat. How can I adjust from being "off beat
Start using a metronome! But set it in several different ways.
In 4/4 time, it's simple to set it so that each click is on each beat - and particularly useful if it has a ping on beat one. That will help you play on the beats, obviously. Doing that will also help you play off the beats - with the 'and' being the silent part in between clicks.
Try setting it at double the tempo, so you now have a click on each beat, but also one on each 'and'.
When you need a change - the clever part. Go back to 4 clicks per bar, and imagine each is the 'and' instead. So, there's nothing, no click, on each beat. Takes a bit of getting used to, but worth persevering with.
If it's guitar you're on, consider the upstrums as off beats - they usually are. When tapping your foot (a good thing to do), imagine there's something above your foot. When your foot comes up for the next tap, it'll hit that thing, and will show exactly where the off beats come.
And lastly - always count. Yes, even seasoned pros still do it! Don't ever consider it's childish or just for beginners - it's paramount! Knowing exactly where you are in any bar (except under the counter..!) is essential. Listen to any music, and try clapping on beat one. Fairly simple. Now try one clap on the & of 2, or the & of 3 and just beat 4. You'll need to count to do this, I guess. And the clapping can work in reverse: clap your eight in the bar, then leave out for example, the & of 1 and just beat 4. There are over 40,000 combinations, so you won't run out too soon...
You have identified your issue as being unsure whether you are 'on' or 'off', so you already understand that syncopation involves accenting the 'weak' beats, such as the second in a pair of quavers or semiquavers 2 and 4 etc.
If you are notating your syncopation ideas you will understand that ties and rests are the syncopator's main tools. If you are not notating your ideas, but memorising or recording them, the process is more difficult.
Assuming that you are notating your ideas, identify the smallest subdivision (the shortest note) in your syncopated passage. Ignoring the pitch of the notes, fill a bar, or several bars with notes of that duration. Say you identified a semiquaver as your shortest note value. In 4/4 you would fill the bar with semiquavers beamed in groups of four, so sixteen per bar. This gives you a way of 'mapping' your rhythm and keeping track of syncopation: you will be able to 'see' whether you are 'on' or 'off'.
If you can tap your foot, nod your head or set a metronome it should be relatively easy to place the beats that land on 'one', 'three' and the first beat in a pair of quavers etc., so now you only need to map the 'off' beats.
You can use this process in reverse to methodically come up with syncopations: try tying the second and third semiquavers; tie the fourth semiquaver with the first semiquaver in the next group of four; or try it with rests. You will gradually come up with a set of syncopations to use. Often reversing a pattern will yield useful results.
If you aren't notating your compositions, try slowing your pattern way down, tap your foot in crotchets first, then try quavers, then semiquavers etc. until all your beats coincide with a tap of your foot. Then you just need to decide for each beat whether it lands on a strong tap or a weak tap.