To understand this statement you need to understand the objective of our existence on earth and what is expected out of us. Allah has created us to worship him.
And I did not create the jinn and mankind except to worship Me. Quran
(51:56)
What is worship?
Shaykhul-Islaam Ibn Taymiyyah (d.728H) said:
“Worship is obedience to Allaah by following that which He ordered
upon the tongues of His Messengers.” He also said, “Worship is a
comprehensive term covering everything that Allaah loves and is
pleased with – whether saying, or actions, outward and inward.”
As part of worship you will be tested to separate the truthful from the wicked.
‘Do the people think that they will be left to say, “We believe” and
they will not be tested? But We have certainly tested those before
them, and Allah will surely make evident those who are truthful, and
He will surely make evident those who are false.’ [Qur’an 29: 2-3]
Example of a Test:
Allah has forbidden consumption of pork. Now either we obey Allah by not eating it or disobey by eating.
Now coming to your question "Allah does not burden a soul beyond that it can bear" means Allah is not going to hold you accountable for what you don't have control over. It also means Allah is not going to test a soul beyond its capacity.
Example: You are caught up in a remote area or forest where nothing is available as food except pork and you are in a state of hunger. You may die of hunger if you don't consume food. In this case you are allowed to eat pork although it was forbidden originally. Hence in this case Allah will not hold you accountable.
He has forbidden you only the Maitah (dead animals), and blood, and
the flesh of swine, and that which is slaughtered as a sacrifice for
others than Allâh (or has been slaughtered for idols, on which Allâh’s
Name has not been mentioned while slaughtering). But if one is forced
by necessity without wilful disobedience nor transgressing due limits,
then there is no sin on him. Truly, Allâh is Oft-Forgiving, Most
Merciful. Quran(2:173)
Levels of testing. Each person is tested according to his capacity.
Sa’d ibn Abi Waqqas reported: I said, “O Messenger of Allah, which
people are tested most severely?” The Messenger of Allah(ﷺ), said, “They are the prophets, then the next
best, then the next best. A man is put to trial according to his
religion. If he is firm in his religion, his trials will be more
severe. If he is weak in his religion, he is put to trial according to
his strength in religion. The servant will continue to be put to trial
until he is left walking upon the earth without any sin.”
Source: Sunan al-Tirmidhī 2398